ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Determining current sort (https://www.excelbanter.com/excel-programming/423346-determining-current-sort.html)

ADK[_2_]

Determining current sort
 
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



Jim Cone[_2_]

Determining current sort
 
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"
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



ADK[_2_]

Determining current sort
 
nevermind

"Jim Cone" wrote:

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"
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




Neptune Dinosaur

Determining current sort
 
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 ........



--
Time is just the thing that keeps everything from happening all at once


"ADK" wrote:

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




All times are GMT +1. The time now is 12:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com