M
MarMo
Hi there ,
The options for the Sort method for Ms excel 2000 and MsExcel 2002/2003 are
slightly different.
The differences are the dataoptions in 2002.
I used both sort methods in the same application , but when i run it in
Excel 2000 i get an error .
Error on "xlSortTextasNumbers"
I would like the apllication i'm building to be used on Excel2000 and Excel
2002 / 2003 and sort the data , even if it's another version of Excel.
To verify which Excel the user is using i capture the application.version
value
Is there a way to do this ?
Any suggestion is welcome
Thanks
MarMo
This is the code i'm using :
'declare variable
Public AppVer
-----------------------
Sub SortOutCustomersNbrs()
AppVer = Application.Version
Application.ScreenUpdating = False
Sheets("Clients").Activate
If AppVer < 10 Then
Worksheets("Clients").Range("A1").Sort _
Key1:=Worksheets("Clients").Columns("A"), Order1:=xlAscending, _
Header:=xlYes, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom
Else
Worksheets("Clients").Range("A1").Sort _
Key1:=Worksheets("Clients").Columns("A"), _
Header:=xlYes, DataOption1:=xlSortTextAsNumbers
End If
Range("A1").Select
Sheets("Start").Activate
Range("A15").Select
Application.ScreenUpdating = True
End Sub
The options for the Sort method for Ms excel 2000 and MsExcel 2002/2003 are
slightly different.
The differences are the dataoptions in 2002.
I used both sort methods in the same application , but when i run it in
Excel 2000 i get an error .
Error on "xlSortTextasNumbers"
I would like the apllication i'm building to be used on Excel2000 and Excel
2002 / 2003 and sort the data , even if it's another version of Excel.
To verify which Excel the user is using i capture the application.version
value
Is there a way to do this ?
Any suggestion is welcome
Thanks
MarMo
This is the code i'm using :
'declare variable
Public AppVer
-----------------------
Sub SortOutCustomersNbrs()
AppVer = Application.Version
Application.ScreenUpdating = False
Sheets("Clients").Activate
If AppVer < 10 Then
Worksheets("Clients").Range("A1").Sort _
Key1:=Worksheets("Clients").Columns("A"), Order1:=xlAscending, _
Header:=xlYes, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom
Else
Worksheets("Clients").Range("A1").Sort _
Key1:=Worksheets("Clients").Columns("A"), _
Header:=xlYes, DataOption1:=xlSortTextAsNumbers
End If
Range("A1").Select
Sheets("Start").Activate
Range("A15").Select
Application.ScreenUpdating = True
End Sub