ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   finding conditional formatting cells (https://www.excelbanter.com/excel-programming/392003-finding-conditional-formatting-cells.html)

greg

finding conditional formatting cells
 
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



mikelee101

finding conditional formatting cells
 
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.
--
Mike Lee
McKinney,TX USA


"greg" wrote:

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





All times are GMT +1. The time now is 05:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com