I don't use OpenOffice. However, a simple Excel macro to utilize an empty column AA to do sorting for you would look like this:
Sub HorizontalSort()
'JBeaucaire (9/5/2009)
Dim LR As Long, LC As Long, i As Long
Application.ScreenUpdating = False
LR = Range("A" & Rows.Count).End(xlUp).Row
For i = 1 To LR
LC = Range("A1").End(xlToRight).Column
Range(Cells(i, "A"), Cells(i, LC)).Copy
Range("AA1").PasteSpecial xlPasteAll, Transpose:=True
Columns("AA:AA").Sort Key1:=Range("AA1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
Range(Range("AA1"), Range("AA1").End(xlDown)).Copy
Cells(i, "A").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:=False, Transpose:=True
Columns("AA:AA").ClearContents
Next i
Application.ScreenUpdating = True
End Sub
This web site appears to offer an OpenOffice Basic converter for Excel VBA:
http://www.business-spreadsheets.com/vba2oo.asp
You can run the code through there to get a possible OpenOffice "version" of my macro.
Bookmarks