Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    May 2004
    Location
    Toronto, Ontario, Canada
    Posts
    425
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Variable not defined (Excel 2003)

    Hi all,
    I have a sub that sorts a list two columns. On my computer the sub works fine without any errors, but on another computer, I keep getting "Variable not defined." Does anyone see within this sub where I might have made a mistake?

    Thanks,
    Darryl.

    Option Explicit
    Sub Sortie()
    Range("A96:B111").Select
    Selection.Sort Key1:=Range("A96"), Order1:=xlAscending, Header:=xlNo, _
    OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
    DataOption1:=xlSortNormal
    End Sub

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Variable not defined (Excel 2003)

    Are the two systems running the same version of Excel? Some of the options you have specified on the Sort method were not available in earlier versions of Excel, and therefore the constants are not defined. For example, DataOption1 is not available on XL2k and, therefore xlSortNormal is not defined on an XL2K system. If you are specifying the default value for those parameters, you should leave them off.
    Legare Coleman

Posting Permissions

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