Sort works in 2003 but not in 2000

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This code works in 2003 but not on another PC with 2000
Selection.Sort Key1:=Range(Cells(13, NewSort1), Cells(13, NewSort1)), _

Order1:=xlAscending, Header:=xlYes, _

OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

Any ideas why not? I do not have access to a PC with 2000 on it.
Other posts mention DataOption2 but this does not appear here.
 
What does "but not on another PC" mean?
What happens when you run the code?
Is the sort done incorrectly.
Do you get an error? If so what error?
How is NewSort1 declared?
What is its value?
Does the Selected range encompass the NewSort1 Column?
Is the code installed in the same place and in the same type of module on both machines?
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Gleam"
wrote in message
This code works in 2003 but not on another PC with 2000
Selection.Sort Key1:=Range(Cells(13, NewSort1), Cells(13, NewSort1)), _

Order1:=xlAscending, Header:=xlYes, _

OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

Any ideas why not? I do not have access to a PC with 2000 on it.
Other posts mention DataOption2 but this does not appear here.
 
Thank you for your suggestions. Here is what I have discovered.
The spreadsheet works fine on one PC with Excel v2003, but fails to work on
another PC with Excel v2000. The second computer is about 45 minutes drive
away.
A third party is running the code on the 2000 PC, so following your
suggestion I went back and got more information.
What is supposed to happen is that when a command button is clicked, the
macro OrigDest runs and sets NewSort1=29 (Column AC) and then calls a
subroutine using this statement "StandardSort NewSort1" (No brackets)

What appears to happen is that a subroutine called Open_Edit_Screen runs
instead. My idea that it was a sort problem appears to be wrong.

Any ideas?
 
What you describe will be very difficult to diagnose from afar.
The only thing that comes to mind is the possibility of event code or an add-in interfering.
Have them uncheck all add-ins in Tools | Add-ins and see what happens.
Make a list of the installed add-ins before unchecking them.
If that cures the problem, then add them back one at a time until the problem occurs.

Also, check the ThisWorkbook module and the module behind each sheet for any
code that might be calling the Open_Edit sub.

Of course, you could pack a sack lunch, go over there and step thru the code. <g>
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Gleam"
wrote in message
Thank you for your suggestions. Here is what I have discovered.
The spreadsheet works fine on one PC with Excel v2003, but fails to work on
another PC with Excel v2000. The second computer is about 45 minutes drive
away.
A third party is running the code on the 2000 PC, so following your
suggestion I went back and got more information.
What is supposed to happen is that when a command button is clicked, the
macro OrigDest runs and sets NewSort1=29 (Column AC) and then calls a
subroutine using this statement "StandardSort NewSort1" (No brackets)

What appears to happen is that a subroutine called Open_Edit_Screen runs
instead. My idea that it was a sort problem appears to be wrong.
Any ideas?
 
For the record, I eventually found a local PC with version 2000 annd found
that if I removed protection from the sheet, the macro buttons worked as
intended. With sheet protection on, the macros were runing the wrong macro.

Thank you for the ideas.
 

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

Back
Top