View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jonco jonco is offline
external usenet poster
 
Posts: 53
Default Sorting problem in a macro

I have a sorting macro that runs on a machine with Excel 2003 but won't run
on Excel 2000. I used the macro recorder to record the macro but it won't
run on the machine with Excel 2000. Is there some change I could make to
the sorting routine that would make it compatible with both versions of
Excel?

The line between the asterisks below is the one that stops during execution
of the macro.


Range("M3:N122").Select ' Select all records in list to sort
****
Selection.Sort Key1:=Range("N3"), Order1:=xlAscending,
Header:=xlGuess,OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
****

Also, do I need all those variables in the macro... like Header MatchCase,
Orientation...etc. All I ewant it to do is sort alphabetically on the
contents in column N .

Any help would be appreciated.
Jonco