These are the two things I am trying:
Neither works, I get a typical 1004 Error that says something to the effect of "The sort reference is not valid. Make sure that it's within the data you want to sort, and the first Sort By box isn't the same of blank."
Note: I have no problems in 2007, I also have no problems running the code on it's on, the only issue is when running it through Workbook_Open()
I'm really lost, I've seen similar problems on the internet but none of those solutions have helped....
Code:
ThisWorkbook.Activate
ActiveWorkbook.Worksheets("Hardware").Range("A1:B501").Sort Key1:=Range("B2:B501"), Order1:=xlDescending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortValue
Code:
ThisWorkbook.Activate
With Sheets("Hardware")
.Range("A1:B501").Sort _
Key1:=Range("B2"), Order1:=xlAscending, Header:=xlYes
End With
Neither works, I get a typical 1004 Error that says something to the effect of "The sort reference is not valid. Make sure that it's within the data you want to sort, and the first Sort By box isn't the same of blank."
Note: I have no problems in 2007, I also have no problems running the code on it's on, the only issue is when running it through Workbook_Open()
I'm really lost, I've seen similar problems on the internet but none of those solutions have helped....