+ Reply to Thread
Results 1 to 4 of 4

active sort question

Hybrid View

  1. #1
    anny
    Guest

    active sort question

    Hi all

    Must a ws be active to do a sort?

    I have a button on sheet1 that, among other things, sorts data on sheet2,
    before reactivating sheet1. Everything works fine, but I'd just as soon not
    show the data on sheet 2 during the sort.

    Any clues appreciated
    anny



  2. #2
    Martin
    Guest

    re: active sort question

    No it doesn't have to be active - it tends to be when the macro's been
    recorded but you can jig the code so that the range being sorted is connected
    directly to the sort method. You've just got to be careful you've specified
    the correct sheet, not just as the range but as the key as well. Eg:

    Worksheets("sheet1").Range("A1:A9").Sort
    Key1:=Worksheets("sheet1").Range("A1"), Order1:=xlAscending

    "anny" wrote:

    > Hi all
    >
    > Must a ws be active to do a sort?
    >
    > I have a button on sheet1 that, among other things, sorts data on sheet2,
    > before reactivating sheet1. Everything works fine, but I'd just as soon not
    > show the data on sheet 2 during the sort.
    >
    > Any clues appreciated
    > anny
    >
    >
    >


  3. #3
    Bob Phillips
    Guest

    re: active sort question

    Why not just try it and see what happens?

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "anny" <[email protected]> wrote in message
    news:[email protected]...
    > Hi all
    >
    > Must a ws be active to do a sort?
    >
    > I have a button on sheet1 that, among other things, sorts data on sheet2,
    > before reactivating sheet1. Everything works fine, but I'd just as soon

    not
    > show the data on sheet 2 during the sort.
    >
    > Any clues appreciated
    > anny
    >
    >




  4. #4
    anny
    Guest

    re: active sort question

    Well I did try it, to no avail. It turns out I hadn't specified the sheet
    in the' key1:=', only the range, as Martin suggested above.

    Thanks to both
    anny

    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Why not just try it and see what happens?
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (remove nothere from email address if mailing direct)
    >
    > "anny" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi all
    >>
    >> Must a ws be active to do a sort?
    >>
    >> I have a button on sheet1 that, among other things, sorts data on
    >> sheet2,
    >> before reactivating sheet1. Everything works fine, but I'd just as soon

    > not
    >> show the data on sheet 2 during the sort.
    >>
    >> Any clues appreciated
    >> anny
    >>
    >>

    >
    >




+ 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