Peter Davison
Active Member
- Joined
- Jun 4, 2020
- Messages
- 444
- Office Version
- 365
- Platform
- Windows
I have the following code that sorts a range of columns with a dynamic number of rows.
What I would like to do is allow the user to be able to select the sort column (e.g. CS20) or their column choice form row 20 to as long as the list is.
I can't work out in my mind how to get the user to be able to choose?
I'd appreciate your help.
Thanks
What I would like to do is allow the user to be able to select the sort column (e.g. CS20) or their column choice form row 20 to as long as the list is.
I can't work out in my mind how to get the user to be able to choose?
I'd appreciate your help.
Thanks
Range("CA20").Select |
Range(Selection, Selection.End(xlToRight)).Select |
Range(Selection, Selection.End(xlDown)).Select |
Selection.Sort key1:=Range("CS20", Range("CS20").End(xlDown)), _ |
order1:=xlAscending, Header:=xlNo |