finding conditional formatting cells

G

greg

I am trying to find cells that have conditional formatting in them.
I was thinking just to turn the cell a specific color. or something.
But I am having a hard time finding them.

For instance. I put a conditional formatting statment on a cell.
then I select a bunch of cells
then I perform the following:

Dim x As Excel.Range
Set x = Excel.Selection
MsgBox x.FormatConditions.Count

and I get -1

is there a way I can ID each cell in a sheet. that has conditional
formatting?

thanks
 
G

Guest

you could try looping through the range cell by cell and using a counter:

for each y in x
if y.formatconditions.count >0 then counter = counter + 1
next y

msgbox counter

hope that helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top