Sorting
Hi,
I recorded the macro to sort some data in Excel and copied the code into my program. But after doing so, the macro won't work. What could be wrong?
Worksheets("Data").Select
Worksheets("Data").Columns("A:L").Select
Worksheets("Data").Range("L1").Select
Selection.Sort Key1:=Range("L1"), Order1:=xlAscending, Key2:=Range("G1") _
, Order2:=xlAscending, Header:=xlYes, OrderCustom:=1, MatchCase:=False _
, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:= _
xlSortNormal
The error message is "Run-time error '1004': Application-defined or object-defined error.
Pls advise.
Thanks in advance.
|