Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting in Excel

Status
Not open for further replies.

Boondy

Technical User
Jan 1, 2003
27
AU
Does anyone know how to sort rows by colour in Excel? IS this possible?

For example I have 100 rows , 30 with black text, 30 with blue and 40 with red, all in random order. I want the spreadsheet to have all the blue at the top, then all the red, followed by all the black.
 
You can probably skip the VBA by rotating the problem. Why are the rows black, red or blue? Is it to do with some data in the row?

If you can write a formula that returns 1 if the row should be blue, 2 if it should be red and 3 if it should be black you can use conditional formatting to colour the row according to the result of the formula. Sorting on the column containing the formula gives you the desired result without any VBA.

This won't work if you have more than 4 colours, you can only have 3 conditional formats plus the original format.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top