Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Macro Sort Problem

I have the following macro that is not working:

ActiveSheet.Unprotect Password:="test"
Range("B3:D52").Select
Selection.Sort Key1:=Range("B3"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A1").Select
ActiveSheet.Protect Password:="test"

My problem is that this macro works perfectly fine for me, however, when I
e-mail it to one of our subsidiary companies to use they get a run time error
and it asks them to debug. When they debug, it highlights the line beginning
with: Selection.Sort Key1:=Range("B3"). Any help on fixing this issue would
be greatly appreciated as I am lost. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Macro Sort Problem

If I remember well, some older versions of Excel can't do this bit:
DataOption1:=xlSortNormal
Just leave it off, so you will get:

ActiveSheet.Unprotect Password:="test"
Range("B3:D52").Select
Selection.Sort Key1:=Range("B3"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A1").Select
ActiveSheet.Protect Password:="test"

RBS


"Hawkfan757" wrote in message
...
I have the following macro that is not working:

ActiveSheet.Unprotect Password:="test"
Range("B3:D52").Select
Selection.Sort Key1:=Range("B3"), Order1:=xlAscending, Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A1").Select
ActiveSheet.Protect Password:="test"

My problem is that this macro works perfectly fine for me, however, when I
e-mail it to one of our subsidiary companies to use they get a run time
error
and it asks them to debug. When they debug, it highlights the line
beginning
with: Selection.Sort Key1:=Range("B3"). Any help on fixing this issue
would
be greatly appreciated as I am lost. Thanks.


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! I am having a problem with sort! RobertD[_2_] Excel Discussion (Misc queries) 2 August 29th 08 07:56 PM
Sort Problem Trish[_2_] Excel Discussion (Misc queries) 1 March 25th 08 11:51 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Sort problem spfas Excel Discussion (Misc queries) 2 December 21st 06 08:25 PM
sort problem derekc[_22_] Excel Programming 2 August 5th 04 07:34 PM


All times are GMT +1. The time now is 12:03 PM.

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

About Us

"It's about Microsoft Excel"