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!

Testing colours of Cells in Excel

Status
Not open for further replies.

tpsmith

Technical User
Jan 5, 2005
25
GB
Hi

Is there any way to test the colour of a cell within Excel.
The colour of the cell not the text in the cell, suppose both would be handy though.

Explanation: We have highlighted certain rows of a spreadsheet in different colours to help identify certain records, we would now like to sort those and group them.

The only way I can think of doing it is creating another field and say something along the lines of:

if Cell A1 = Red then value = 1 or
if Cell A2 = Blue then value = 2

We could then sort on this value.
 
Hi gizmo1973,

thanks for the post but I am afraid i cannot seem to find it. If you have a more direct link it would be greatly appreciated.
Regards
Tony
 
I would like to point out though that this is a workaround and a good example of why you should not use colour to identify records in excel. There are no inbuilt features to reference colours - it can only be done through VBA.

It is generally a better idea to use an extra column and mark the rows with numeric or Alpha/Numeric markers to identify them

You can then use conditional formatting or just standard colour filling to make them visually representative but you can use the markers to filter / sort on etc

Rgds, Geoff

"Three things are certain: Death, taxes and lost data. Guess which has occurred"

Please read FAQ222-2244 before you ask a question
 
Superb Thanks, lots of toys to play with :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top