I have been trying to sort a column from an excel file. I have a bit of code that is able to do number formatting as well as other formatting but I cant find anything that is for sorting. The one thing that I did find wants to use Range and I am getting errors when I run the script.
Here is what I have so far. I have also tried to use oSheet.Range. Any help would be greatly appreciated. Thanks!
Set oSheet = oBook.Worksheets.Item(1)
oSheet.Columns("C").NumberFormat = "_(#,##0.00_);_((#,##0.00);_("" - ""??_);_(@_)"
oSheet.Columns("A:C").sort key1:=Range("C"), order1:=Descending, Header:=xlYes
Set oSheet = Nothing
Last seen: 14 hours 4 min ago
Joined: 07/29/2021 - 10:01