|
-
May 10th, 2006, 02:14 AM
#1
Thread Starter
New Member
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..
-
May 10th, 2006, 07:03 AM
#2
Re: Question - Sorting by specified values

 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.
Last edited by cssriraman; May 13th, 2006 at 02:56 PM.
CS
-
May 10th, 2006, 07:24 AM
#3
Re: Question - Sorting by specified values
Jonatan, welcome to the forums
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.
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
May 10th, 2006, 11:44 AM
#4
Thread Starter
New Member
Re: Question - Sorting by specified values
Ah..
Thank you, that seemed to help a lot..
Thx.
-
May 13th, 2006, 02:55 PM
#5
Re: Question - Sorting by specified values
Please resolve the thread if you get an answer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|