I have this code assigned to a button in excel 2003 but when I open the file in excel 2010 the button does not work. Any help would be appreciated. The file is opened in compatibility mode. It's .xls
Thanks!
Private Sub SORT_Click()
Dim myRng As Range
With ActiveSheet
Set myRng = .Range("A3:Z" & .Cells(.Rows.Count, "A").End(xlUp).Row)
myRng.SORT Key1:=Range("A3"), Order1:=xlAscending, Key2:=Range("O3") _
, Order2:=xlDescending, Header:=xlNo, OrderCustom:=1, MatchCase:=False _
, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:= _
xlSortNormal
End With
myRng.Rows.AutoFit
Range("A3:A3").Select
End Sub
Bookmarks