Consulting

Results 1 to 6 of 6

Thread: Sorting

  1. #1

    Sorting

    I'm getting a runtime error. Any suggestions!????

    Here's the code:

    [vba]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
    [/vba]
    THANKS!

  2. #2
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    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.
    Peace of mind is found in some of the strangest places.

  3. #3
    VBAX Tutor
    Joined
    Mar 2005
    Posts
    268
    Location
    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.

  4. #4
    VBAX Tutor
    Joined
    Mar 2005
    Posts
    268
    Location
    If this is on Mac, then austenr's reply is the answer you need.

  5. #5
    VBAX Regular
    Joined
    Nov 2005
    Posts
    82
    Location
    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

  6. #6
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •