I do not use Writer, Impress or Base and I have no interest in making macros in these programs.
Speaking of Calc, I could also use a macro like this:
Code: Select all
Sub Ordenar
dim aSortFields(0) as new "com.sun.star.table.TableSortField"
aSortFields(0).Field = 0
aSortFields(0).IsAscending = true
aSortFields(0).IsCaseSensitive = false
dim aSortDesc(1) as new com.sun.star.beans.PropertyValue
aSortDesc(0).Name = "SortFields"
aSortDesc(0).Value = aSortFields
aSortDesc(1).Name = "ContainsHeader"
aSortDesc(1).Value = true
thiscomponent.sheets(0).getcellrangebyname("A1:E50001").sort(aSortDesc)
End Sub