Question - Sorting by specified values
Is it possible to set the macro to sort in a specific order, set by me?
For instance, if I want specific words sorted not necessarily alphabetiacally, is that possible?
For instance if I have these words:
And I want them to sort like this:
- Principal
- Teacher
- Pupil
That's not alphabetically sorted and it's not numerically sorted.
How do I go about it?
Here's the macro created to sort the column alphabetically:
Code:
Sub ConfRank()
'
' ConfRank Makro
'
'
Range("C5:AR24").Select
Range("AR24").Activate
Selection.Sort Key1:=Range("V5"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("V5:V24").Select
ActiveWindow.Zoom = 100
End Sub
Any help is appreciated..
Re: Question - Sorting by specified values
http://www.vbforums.com/
Quote:
Originally Posted by JonatanRaven
For instance if I have these words:
And I want them to sort like this:
- Principal
- Teacher
- Pupil
That's not alphabetically sorted and it's not numerically sorted.
I think there is no difference between two list you gave. Then what sorting you want?
Please give us more detail so that we can help you better.
Re: Question - Sorting by specified values
Jonatan, welcome to the forums :wave:
The best way to achieve this is by using the Custom List feature in Excel.
Goto -->>Tools-->>Options-->>Custom Lists. Click Add and enter the list in the sort order that you need, or you can import it from a range - if that range is correctly ordered.
Then when you need to sort by that order - in the Sort dialog click on Options... and change the "First key sort order" from normal to your custom list.
Re: Question - Sorting by specified values
Ah..
Thank you, that seemed to help a lot..
Thx.
Re: Question - Sorting by specified values
Please resolve the thread if you get an answer