Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 205
  • Last Modified:

Custom sort

I have two columns that I want to custom sort, The first column guides how the second column can be sorted the First is sorted alphabetically.  The second column is also but I want the first value to always be the value "Orange" if it is available.   Example

Object       Color
Door      red
Door      orange
Door       Blue
Door      Yellow
Chair      orange
Chair      blue
Chair      red
Chair      yellow
Chair      pink
Chest      red
Chest      blue
Chest      green
      
The way I want the sort to look each time      
Object       Color
Door      orange
Door      Blue
Door       red
Door      yellow
Chair      orange
Chair      blue
Chair      pink
Chair      red
Chair      yellow
Chest      blue
Chest      green
Chest      red

Thanks,
Montrof
0
montrof
Asked:
montrof
  • 2
1 Solution
 
johnb25Commented:
Montrof,

You can create a Custom List with the colours in the order you want.
List the colours you want in the order you want.
In Excel Options/Advanced, go to Custom Lists. You can import the list of colours you have already sorted.
In Data Sort you can select Custom Lists from the Sort Order drop-down box.

You mentioned that the first column is sorted alphabetically, but in your example it is not sorted that way. If it is also to be sorted in the order shown above you can also repeat the steps above for this list.

John
0
 
montrofAuthor Commented:
John,

Thanks for the reply but I need this to be done in vba because this is a piece of what I am trying to accomplish.  The data is loaded each day so that is why I want to automate it.  

Thanks,
Montrof
0
 
montrofAuthor Commented:
I took what you said and just made it into a macro and works perfect.  

Thanks,
Montrof
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now