PDA

View Full Version : Sorting



dkelb
11-23-2005, 10:22 AM
I'm getting a runtime error. Any suggestions!????

Here's the code:

With Selection
.Sort Key1:=Range("V7"), Order1:=xlAscending, Key2:=Range("U7") _
, Order2:=xlDescending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _
:=xlSortNormal
End With

THANKS!

austenr
11-23-2005, 10:35 AM
Are you developing this on one version and trying to go back and run it on another version? (Ex. developed in Microsoft Office XP and running it on a Windows 97 machine)?

I think I had that problem once and believe I had to get rid of the DataOption part. Has been a long time though.

BlueCactus
11-23-2005, 10:37 AM
Is this a Mac issue too? If it is, I'll move it like I moved the others.

Mac VBA has quite a few differences when compared to Win VBA. Because of that we have a separate forum for Mac VBA (http://vbaexpress.com/forum/forumdisplay.php?f=49) . Helps cut down on some of the confusion.

BlueCactus
11-23-2005, 11:17 AM
If this is on Mac, then austenr's reply is the answer you need.

Amanda1
11-23-2005, 12:02 PM
Hi dkelb,

Might be a daft question, but what is the range you have designated, before the sort selection. If they are out of synch, it will give a runtime error.

Cheers

Amanda:read:

dkelb
11-23-2005, 12:46 PM
Thanks for the responses!

The versions are the same.

It IS a MAC issue. Please move if you think that will help.

Maybe the range is goofed up.