austenr
04-29-2005, 06:53 AM
I know I have seen this before but cannot find it. The following code runs in XP but causes a compile error when run in 97. The error is on the xlSortNormal. What is the correct way to make it cross version compatable?
Sub SortDataList() '\sorts the data list after new row is entered
With Range("DataBase").Parent
.Range("A2:D65536").Sort Key1:=.Range("A2"), Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End With
End Sub :help
Sub SortDataList() '\sorts the data list after new row is entered
With Range("DataBase").Parent
.Range("A2:D65536").Sort Key1:=.Range("A2"), Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End With
End Sub :help