Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default sorting with a macro

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default sorting with a macro

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

On Sun, 20 Apr 2008 16:04:00 -0700, Kelly********
wrote:

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default sorting with a macro

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

Kelly******** wrote:

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


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default sorting with a macro

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

Thanks for the reminder.


Gord

On Sun, 20 Apr 2008 18:47:46 -0500, Dave Peterson
wrote:

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

Kelly******** wrote:

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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default sorting with a macro

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

"Dave Peterson" wrote:

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

Kelly******** wrote:

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


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Macro for sorting Brad[_6_] Excel Worksheet Functions 2 August 10th 09 04:20 PM
Sorting macro Phrank Excel Programming 2 November 16th 07 10:56 AM
macro for sorting cherrynich Excel Discussion (Misc queries) 1 December 30th 04 04:47 PM
Sorting with a macro? gschimek Excel Programming 2 August 29th 03 09:57 PM
Sorting w/Macro Joe[_24_] Excel Programming 1 August 28th 03 07:44 PM


All times are GMT +1. The time now is 02:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"