Consulting

Results 1 to 2 of 2

Thread: Finding Sort Order

  1. #1

    Finding Sort Order

    I have a spreadsheet that gets sorted from a userform. When I load the userform, I would like to be able to know how the spreadsheet is sorted. It will either be on col-B or col-I depending on which was last used by the user.

    I realize I can "force" a sort one-way-or-the-other when I load the userform, but it would be easier if I could just Know which way it is sorted?

    ttfn
    Kicker

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    What you can do is designate a cell to hold the info for you, let's say z1. So when the User Form sorts the data based on what the user wants, that info is stored to z1.

    For example, the user sorts by Col B, then in the code that sorts the data add the line.

    Range("Z1").Value = 2
    or

    Range("Z1").Value = "B"
    Then you can retrieve that info whenever you want.

Posting Permissions

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