View Full Version : [SOLVED:] Finding Sort Order

08-28-2004, 05:09 PM
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?


Jacob Hilderbrand
08-28-2004, 05:24 PM
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


Range("Z1").Value = "B"

Then you can retrieve that info whenever you want.