sorting with a macro

K

Kelly********

why dont this work on other machine(pc) copied to same location(folder) same
name and every thing. the only thing is I used excel 2002 and I dont know
what ver the other pc has on it.
Sub Sort_Drivers()
'
' Sort_Drivers Macro
' Macro by Kelly
'

'
Application.Run "'Points Tracker.xls'!UnprotectAll"
Range("A4:AM104").Select
Range("A4").Activate
Selection.Sort Key1:=Range("A4"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A4").Select
Application.Run "'Points Tracker.xls'!ProtectAll"
End Sub
Sub Sort_Rank()
'
' Sort_Rank Macro
' Macro by Kelly
'

'
Application.Run "'Points Tracker.xls'!UnprotectAll"
Range("A4:AM104").Select
Range("AM4").Activate
Selection.Sort Key1:=Range("AM4"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A4").Select
Application.Run "'Points Tracker.xls'!ProtectAll"
End Sub
 
G

Gord Dibben

Just curious but what is "don't work" and are both macros "not working"?

Error message? Nothing? Improper sort or rank?

Sheets remain protected?


Gord Dibben MS Excel MVP
 
D

Dave Peterson

The DataOption1 stuff was added in xl2002. Remove that portion and it should
work in earlier versions, too.
 
G

Gord Dibben

I forget that stuff(some other stuff too) all the time.

Thanks for the reminder.


Gord
 
K

Kelly********

took out DataOption1:=xlSortNormal and it errors.
can you show me what to take out or modify
 
D

Dave Peterson

Did you remember to remove the comma and the continuation characters from the
previous line?

If you did, please post your current code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top