Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 75
Default Macro with custom sort order

I'm having trouble with the code for a macro that needs a custom sort order
for the second sort key.

I have three sort keys -- the first and third are regular sorts, but the
second needs to sort by custom list 6. Does anyone know how to do this?


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Macro with custom sort order

If you use xl2003 and try to do this manually, you'll see that you can only
specify the primary key for the custom sort order.

You could do multiple sorts, though.

One sort by the 2nd and 3rd key, then one more sort for the 1st key.



Erin wrote:

I'm having trouble with the code for a macro that needs a custom sort order
for the second sort key.

I have three sort keys -- the first and third are regular sorts, but the
second needs to sort by custom list 6. Does anyone know how to do this?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 75
Default Macro with custom sort order

Thanks so much -- this worked perfectly!

"Dave Peterson" wrote:

If you use xl2003 and try to do this manually, you'll see that you can only
specify the primary key for the custom sort order.

You could do multiple sorts, though.

One sort by the 2nd and 3rd key, then one more sort for the 1st key.



Erin wrote:

I'm having trouble with the code for a macro that needs a custom sort order
for the second sort key.

I have three sort keys -- the first and third are regular sorts, but the
second needs to sort by custom list 6. Does anyone know how to do this?


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default Macro with custom sort order

Are you using the Excel Sort feature or does your macro include a sort
algorithm?
If the later: add a table into the code like this
Red 1
Blue 2
Green 3
Now use the number in the second column as a sorting proxy for the value in
the first column
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Erin" wrote in message
...
I'm having trouble with the code for a macro that needs a custom sort
order
for the second sort key.

I have three sort keys -- the first and third are regular sorts, but the
second needs to sort by custom list 6. Does anyone know how to do this?




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 75
Default Macro with custom sort order

Thanks for your response, but I did get it to work with the first
recommendation.

"Bernard Liengme" wrote:

Are you using the Excel Sort feature or does your macro include a sort
algorithm?
If the later: add a table into the code like this
Red 1
Blue 2
Green 3
Now use the number in the second column as a sorting proxy for the value in
the first column
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Erin" wrote in message
...
I'm having trouble with the code for a macro that needs a custom sort
order
for the second sort key.

I have three sort keys -- the first and third are regular sorts, but the
second needs to sort by custom list 6. Does anyone know how to do this?







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Sort Order - Wildcard? Budget Programmer Excel Worksheet Functions 2 April 22nd 23 04:10 AM
Custom Sort Order Fishnerd Excel Discussion (Misc queries) 2 January 7th 08 06:24 AM
Sort sheet based on particuilar sort order Also Excel Worksheet Functions 4 January 3rd 08 09:31 AM
Can I save a custom sort order for a specific spreadsheet? BarKay Excel Worksheet Functions 1 March 14th 07 03:19 PM
Using a macro to sort your data in alphabetical order? Carrie Excel Discussion (Misc queries) 1 April 14th 05 03:07 PM


All times are GMT +1. The time now is 08:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"