Sort a row of strings, some containing blanks
The Key argument is commented out, which looks a problem to me.
Also it is in workbook_open. DO you realise that only runs when the workbook
is opened, and have you put it in the ThisWorkbook code module?
Is FA_budget_lines a defined name?
--
HTH
RP
(remove nothere from the email address if mailing direct)
"KobusD" wrote in message
ups.com...
I am trying to sort a row, some cells contains strings and others
blanks. Range = "B18" to "AY18"
The "SORT" below does nothing! Can anyone see why?
---------
Private Sub Workbook_Open()
Dim OldRange As Range
Set OldRange = Worksheets("Variables").Range("FA_budget_lines")
OldRange.Sort 'Key1:=OldRange(1), Order1:=xlAscending, _ Header:=xlNo,
Orientation:=xlSortColumns
'some more code goes here...
End Sub
|