+ Reply to Thread
Results 1 to 9 of 9

sort issue

  1. #1
    Shawn
    Guest

    sort issue

    Here is my code:

    Range("A6", Range("G65536").End(xlUp)).Select
    Selection.Sort Key1:=Range("G7"), Order1:=xlDescending, Header:=xlGuess, _
    OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
    DataOption1:=xlSortNormal
    Range("A6").Select


    It works fine on my machine. However, when I e-mail this file to other
    users, they get an error and the Selection code is highlighted???
    --
    Thanks
    Shawn

  2. #2
    Dave Peterson
    Guest

    Re: sort issue

    Are you all using the same version of excel?

    DataOption1:=xlSortNormal
    was added in xl2002.

    If your users use earlier versions, remove that parm.

    Shawn wrote:
    >
    > Here is my code:
    >
    > Range("A6", Range("G65536").End(xlUp)).Select
    > Selection.Sort Key1:=Range("G7"), Order1:=xlDescending, Header:=xlGuess, _
    > OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
    > DataOption1:=xlSortNormal
    > Range("A6").Select
    >
    > It works fine on my machine. However, when I e-mail this file to other
    > users, they get an error and the Selection code is highlighted???
    > --
    > Thanks
    > Shawn


    --

    Dave Peterson

  3. #3
    Norman Jones
    Guest

    Re: sort issue

    Hi Shawn,

    If your user has abn earlier version (xl2k?) then:

    DataOption1:=xlSortNormal

    would cause a problem as this argument would not be recognised.

    When writing an application, it is important to develop using oldest version
    of Excel likely to be encountered.


    ---
    Regards,
    Norman



    "Shawn" <[email protected]> wrote in message
    news:[email protected]...
    > Here is my code:
    >
    > Range("A6", Range("G65536").End(xlUp)).Select
    > Selection.Sort Key1:=Range("G7"), Order1:=xlDescending,
    > Header:=xlGuess, _
    > OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
    > DataOption1:=xlSortNormal
    > Range("A6").Select
    >
    >
    > It works fine on my machine. However, when I e-mail this file to other
    > users, they get an error and the Selection code is highlighted???
    > --
    > Thanks
    > Shawn




  4. #4
    Shawn
    Guest

    Re: sort issue

    How should I write that code?

    There error is: "Compile error, variable not defined"
    --
    Thanks
    Shawn


    "Norman Jones" wrote:

    > Hi Shawn,
    >
    > If your user has abn earlier version (xl2k?) then:
    >
    > DataOption1:=xlSortNormal
    >
    > would cause a problem as this argument would not be recognised.
    >
    > When writing an application, it is important to develop using oldest version
    > of Excel likely to be encountered.
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    >
    > "Shawn" <[email protected]> wrote in message
    > news:[email protected]...
    > > Here is my code:
    > >
    > > Range("A6", Range("G65536").End(xlUp)).Select
    > > Selection.Sort Key1:=Range("G7"), Order1:=xlDescending,
    > > Header:=xlGuess, _
    > > OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
    > > DataOption1:=xlSortNormal
    > > Range("A6").Select
    > >
    > >
    > > It works fine on my machine. However, when I e-mail this file to other
    > > users, they get an error and the Selection code is highlighted???
    > > --
    > > Thanks
    > > Shawn

    >
    >
    >


  5. #5
    Shawn
    Guest

    Re: sort issue

    If I remove: , _
    DataOption1:=xlSortNormal
    it will work in any version?

    --
    Thanks
    Shawn


    "Dave Peterson" wrote:

    > Are you all using the same version of excel?
    >
    > DataOption1:=xlSortNormal
    > was added in xl2002.
    >
    > If your users use earlier versions, remove that parm.
    >
    > Shawn wrote:
    > >
    > > Here is my code:
    > >
    > > Range("A6", Range("G65536").End(xlUp)).Select
    > > Selection.Sort Key1:=Range("G7"), Order1:=xlDescending, Header:=xlGuess, _
    > > OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
    > > DataOption1:=xlSortNormal
    > > Range("A6").Select
    > >
    > > It works fine on my machine. However, when I e-mail this file to other
    > > users, they get an error and the Selection code is highlighted???
    > > --
    > > Thanks
    > > Shawn

    >
    > --
    >
    > Dave Peterson
    >


  6. #6
    Norman Jones
    Guest

    Re: sort issue

    Hi Shawn,

    As suggested By Dave in his adjacent post, delete the contentious parameter:

    Selection.Sort Key1:=Range("G7"), _
    Order1:=xlDescending, _
    Header:=xlGuess, _
    OrderCustom:=1, _
    MatchCase:=False, _
    Orientation:=xlTopToBottom

    ---
    Regards,
    Norman



    "Shawn" <[email protected]> wrote in message
    news:[email protected]...
    > How should I write that code?
    >
    > There error is: "Compile error, variable not defined"
    > --
    > Thanks
    > Shawn
    >
    >
    > "Norman Jones" wrote:
    >
    >> Hi Shawn,
    >>
    >> If your user has abn earlier version (xl2k?) then:
    >>
    >> DataOption1:=xlSortNormal
    >>
    >> would cause a problem as this argument would not be recognised.
    >>
    >> When writing an application, it is important to develop using oldest
    >> version
    >> of Excel likely to be encountered.
    >>
    >>
    >> ---
    >> Regards,
    >> Norman
    >>
    >>
    >>
    >> "Shawn" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > Here is my code:
    >> >
    >> > Range("A6", Range("G65536").End(xlUp)).Select
    >> > Selection.Sort Key1:=Range("G7"), Order1:=xlDescending,
    >> > Header:=xlGuess, _
    >> > OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
    >> > DataOption1:=xlSortNormal
    >> > Range("A6").Select
    >> >
    >> >
    >> > It works fine on my machine. However, when I e-mail this file to other
    >> > users, they get an error and the Selection code is highlighted???
    >> > --
    >> > Thanks
    >> > Shawn

    >>
    >>
    >>




  7. #7
    Shawn
    Guest

    Re: sort issue

    Is that causing, "compile error, variable not defined?"
    --
    Thanks
    Shawn


    "Norman Jones" wrote:

    > Hi Shawn,
    >
    > As suggested By Dave in his adjacent post, delete the contentious parameter:
    >
    > Selection.Sort Key1:=Range("G7"), _
    > Order1:=xlDescending, _
    > Header:=xlGuess, _
    > OrderCustom:=1, _
    > MatchCase:=False, _
    > Orientation:=xlTopToBottom
    >
    > ---
    > Regards,
    > Norman
    >
    >
    >
    > "Shawn" <[email protected]> wrote in message
    > news:[email protected]...
    > > How should I write that code?
    > >
    > > There error is: "Compile error, variable not defined"
    > > --
    > > Thanks
    > > Shawn
    > >
    > >
    > > "Norman Jones" wrote:
    > >
    > >> Hi Shawn,
    > >>
    > >> If your user has abn earlier version (xl2k?) then:
    > >>
    > >> DataOption1:=xlSortNormal
    > >>
    > >> would cause a problem as this argument would not be recognised.
    > >>
    > >> When writing an application, it is important to develop using oldest
    > >> version
    > >> of Excel likely to be encountered.
    > >>
    > >>
    > >> ---
    > >> Regards,
    > >> Norman
    > >>
    > >>
    > >>
    > >> "Shawn" <[email protected]> wrote in message
    > >> news:[email protected]...
    > >> > Here is my code:
    > >> >
    > >> > Range("A6", Range("G65536").End(xlUp)).Select
    > >> > Selection.Sort Key1:=Range("G7"), Order1:=xlDescending,
    > >> > Header:=xlGuess, _
    > >> > OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
    > >> > DataOption1:=xlSortNormal
    > >> > Range("A6").Select
    > >> >
    > >> >
    > >> > It works fine on my machine. However, when I e-mail this file to other
    > >> > users, they get an error and the Selection code is highlighted???
    > >> > --
    > >> > Thanks
    > >> > Shawn
    > >>
    > >>
    > >>

    >
    >
    >


  8. #8
    Norman Jones
    Guest

    Re: sort issue

    Hi Shawn,

    Yes - in versions prior to xl2002.

    ---
    Regards,
    Norman



    "Shawn" <[email protected]> wrote in message
    news:[email protected]...
    > Is that causing, "compile error, variable not defined?"
    > --
    > Thanks
    > Shawn
    >
    >
    > "Norman Jones" wrote:
    >
    >> Hi Shawn,
    >>
    >> As suggested By Dave in his adjacent post, delete the contentious
    >> parameter:
    >>
    >> Selection.Sort Key1:=Range("G7"), _
    >> Order1:=xlDescending, _
    >> Header:=xlGuess, _
    >> OrderCustom:=1, _
    >> MatchCase:=False, _
    >> Orientation:=xlTopToBottom
    >>
    >> ---
    >> Regards,
    >> Norman
    >>
    >>
    >>
    >> "Shawn" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > How should I write that code?
    >> >
    >> > There error is: "Compile error, variable not defined"
    >> > --
    >> > Thanks
    >> > Shawn
    >> >
    >> >
    >> > "Norman Jones" wrote:
    >> >
    >> >> Hi Shawn,
    >> >>
    >> >> If your user has abn earlier version (xl2k?) then:
    >> >>
    >> >> DataOption1:=xlSortNormal
    >> >>
    >> >> would cause a problem as this argument would not be recognised.
    >> >>
    >> >> When writing an application, it is important to develop using oldest
    >> >> version
    >> >> of Excel likely to be encountered.
    >> >>
    >> >>
    >> >> ---
    >> >> Regards,
    >> >> Norman
    >> >>
    >> >>
    >> >>
    >> >> "Shawn" <[email protected]> wrote in message
    >> >> news:[email protected]...
    >> >> > Here is my code:
    >> >> >
    >> >> > Range("A6", Range("G65536").End(xlUp)).Select
    >> >> > Selection.Sort Key1:=Range("G7"), Order1:=xlDescending,
    >> >> > Header:=xlGuess, _
    >> >> > OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,
    >> >> > _
    >> >> > DataOption1:=xlSortNormal
    >> >> > Range("A6").Select
    >> >> >
    >> >> >
    >> >> > It works fine on my machine. However, when I e-mail this file to
    >> >> > other
    >> >> > users, they get an error and the Selection code is highlighted???
    >> >> > --
    >> >> > Thanks
    >> >> > Shawn
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>




  9. #9
    Dave Peterson
    Guest

    Re: sort issue

    That's the default for xl2002+, so it should.

    Shawn wrote:
    >
    > If I remove: , _
    > DataOption1:=xlSortNormal
    > it will work in any version?
    >
    > --
    > Thanks
    > Shawn
    >
    > "Dave Peterson" wrote:
    >
    > > Are you all using the same version of excel?
    > >
    > > DataOption1:=xlSortNormal
    > > was added in xl2002.
    > >
    > > If your users use earlier versions, remove that parm.
    > >
    > > Shawn wrote:
    > > >
    > > > Here is my code:
    > > >
    > > > Range("A6", Range("G65536").End(xlUp)).Select
    > > > Selection.Sort Key1:=Range("G7"), Order1:=xlDescending, Header:=xlGuess, _
    > > > OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
    > > > DataOption1:=xlSortNormal
    > > > Range("A6").Select
    > > >
    > > > It works fine on my machine. However, when I e-mail this file to other
    > > > users, they get an error and the Selection code is highlighted???
    > > > --
    > > > Thanks
    > > > Shawn

    > >
    > > --
    > >
    > > Dave Peterson
    > >


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1