G
gordonmytuba
How do I sort data in an Excel worksheet from a .vbs script file?
Or can I programmatically create a macro into the .xls file I create from
the .vbs file and then have it run when I load the sheet from the script?
Here's the macro of sorting the data:
Sub SortData()
Range("A1:N20").Select
Range("N20").Activate
Selection.Sort Key1:=Range("F2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub
Thanks for any help.
Or can I programmatically create a macro into the .xls file I create from
the .vbs file and then have it run when I load the sheet from the script?
Here's the macro of sorting the data:
Sub SortData()
Range("A1:N20").Select
Range("N20").Activate
Selection.Sort Key1:=Range("F2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub
Thanks for any help.