Compatibility with older versions of Excel

C

ChuckM

Can use some help here.

I wrote a macro in Excel 2002....I tried to run it on Excel 2000 and had problems.

Specifically I have this sorting command as follows:

Range(Cells(4, 1), Cells(endrow, 10)).Sort Key1:=Range("D4"),
Order1:=xlAscending, Key2:=Range( _
"E4"), Order2:=xlAscending, Key3:=Range("C4"), Order3:=xlDescending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal

Fine in 2002, but 2000 does not like the DataOption1: argument.

Any help will be welcome.
Thanks
Chuck
 
H

Harald Staff

Hi Chuck

Delete everything after
xlTopToBottom
and hope that it will sort normal anyway. I think it will.
 
T

Tom Ogilvy

Remove the last 3 options (dataoptionx:= ) since they were not added until
version 2002. You aren't using them, so you don't need them in either
version.
 

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