Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Six Six is offline
external usenet poster
 
Posts: 1
Default sorting using VBA

You don't really need a macro to perform this : You will
need first to create a Custom list ( in tools option ) to
define the index of your colors. Then simply apply a
Data / Sort, Key1 : you color column, Key2 : names.
Clicking on options will let you change the first key
order from normal to your psero list.

If you want however to use a macro, here is the code you
might use to create this perso list:
Application.AddCustomList ListArray:=Array
("red", "yellow", "green").
To call, use ( in this case, "8" being the index you just
created ): Selection.Sort Key1:=Range("A1"), OrderCustom:=8

-----Original Message-----
If I have a list of names each with a category attached,
eg poeples names and then favourite colours, how can I
sort those names according to colour but in a pre-defined
order such as red first then yellow, etc whilst keeping
the names in alphabetical order? I need to write a macro
for this, but it's proving just too tricky for me.

Thanks,

Bob
.

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
Sorting Values Without Sorting Formulas SBX Excel Discussion (Misc queries) 2 April 12th 09 11:17 PM
Automatic sorting (giving max and min) based on custom sorting lis Joe Lewis[_2_] Excel Worksheet Functions 4 November 23rd 08 05:12 AM
Sorting VLookup vs Sorting SumProduct Lauren Excel Discussion (Misc queries) 1 August 21st 07 12:19 AM
Sorting: Sorting by the First Character dzuy Excel Discussion (Misc queries) 2 June 22nd 06 08:27 PM
Sorting ListBox results or transposing ListBox values to other cells for sorting Rob[_8_] Excel Programming 1 July 9th 03 04:35 AM


All times are GMT +1. The time now is 06:03 AM.

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

About Us

"It's about Microsoft Excel"