Determining current sort

A

ADK

Is there a way to take a range (say: A7:S10000) and determine what the
current sort order is? I have a userform that allows the user to select which
column they wish to sort by but would like to display on the user form what
the current sort by column is. The columns I allow the user to sort within
the range indicated above is B,C,D,E,G,H,I,P,Q,R

Thanks,

ADK

Using Excel 2000 and beginner at vba
 
J

Jim Cone

It is not clear what you mean by "current sort order"?
The Order1 property (ascending or descending) is not the same as the
Key1 property (the sort column).

If you want to display what column the user selected, then you could
place a "label" on the form with the column address,
or you could place a list box on the form filled with the allowed sort columns,
or you could select the sort column on the worksheet or...

A specific suggestion requires more details from you.
--
Jim Cone
james.coneXXX at comcast.netXXX (remove xxx)
Portland, Oregon USA
("Special Sort" - two dozen additional ways to sort - email and ask for the free trial version)




"ADK" <[email protected]>
wrote in message
Is there a way to take a range (say: A7:S10000) and determine what the
current sort order is? I have a userform that allows the user to select which
column they wish to sort by but would like to display on the user form what
the current sort by column is. The columns I allow the user to sort within
the range indicated above is B,C,D,E,G,H,I,P,Q,R

Thanks,
ADK
Using Excel 2000 and beginner at vba
 
N

Neptune Dinosaur

You could set the value of a variable at the time the user makes the choice
of column. This could then determine the (text) value of a label that is
placed somewhere on the Worksheet.

BUT, there would be nothing to stop a user from doing a MANUAL sort such
that the sort order no longer corresponded with the last label that was
placed on the sheet ........
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top