Hi everybody, I tried your routines for the sort. In one of the examples it said that the routines only work for small tables. How, I have a calc-table for appr. 1200 lines. How can I handles such a table.
As you can see, I took your example with minorchanges: Dim oSheetDSC,oDSCRange As Object Dim aSortFields(0) As New com.sun.star.util.SortField Dim aSortDesc(0) As New com.sun.star.beans.PropertyValue 'set your sheet name rem oSheetDSC = ThisComponent.oTabellenListe.getByIndex("Tabelle2") oSheetDSC = oTabellenListe.getByIndex("Tabelle2") 'set your range address oDSCRange = oSheetDSC.getCellRangeByName("A1:Z2000") rem ThisComponent.getCurrentController.select(oDSCRange) rem getCurrentController.select(oDSCRange) aSortFields(0).Field = 1 aSortFields(0).SortAscending = TRUE aSortDesc(0).Name = "SortFields" aSortDesc(0).Value = aSortFields() oDSCRange.Sort(aSortDesc()) The CurrentController statement causes an error; probably because I have no form in the routine. Therefore I have on only a REM statement. Thanks in advance. Rudi