ASAP Utilities (http://www.asap-utilities.com/) is a free Excel add-in loaded with lots of useful tricks. One of them is the ability to select cells based on color.
- Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services, Inc. http://PeltierTech.com
Yeah it should be. This is code that sets the colour of a selected cell to orange
With Selection.Interior .ColorIndex = 44 .Pattern = xlSolid .PatternColorIndex = xlAutomatic End With
It includes the pattern. To make it easier make sure the pattern is consistant for all the cells. As you loop over the cells, or access a cell, look at the Interior.ColorIndex property.
You'll need to work out what colour has what colour index though. there are a few contants you can use vbBlack and vbWhite.
Selecting Data By....
Liebethal
Thank you very much for the replies. They were very helpful. =)
Tiger
Nian2000
This knowledge base article has a nalternative approach:
How to use AutoFilter to filter records based on cell formatting in Excel
http://support.microsoft.com/Default.aspx kbid=213923
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com
DannoMontano
ASAP Utilities (http://www.asap-utilities.com/) is a free Excel add-in loaded with lots of useful tricks. One of them is the ability to select cells based on color.
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com
Blastobi
Hi tiger,
Yeah it should be. This is code that sets the colour of a selected cell to orange
With Selection.Interior
.ColorIndex = 44
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
It includes the pattern. To make it easier make sure the pattern is consistant for all the cells. As you loop over the cells, or access a cell, look at the Interior.ColorIndex property.
You'll need to work out what colour has what colour index though. there are a few contants you can use vbBlack and vbWhite.