ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Testing Blank Conditional Formatting (https://www.excelbanter.com/excel-programming/411476-testing-blank-conditional-formatting.html)

MacGuy

Testing Blank Conditional Formatting
 
I'm having a problem testing for a blank cell with conditional formatting.

I'm looping through a range of cells and when I get to a cell that I know
should evaluate to TRUE for having met the conditional format it is returning
false. The conditional format is when cell value is equal to blank (="")
then format cell with fill color.

cfStatus = testRange.Value = testRange.FormatConditions.Formula1

where testRange.value is blank and testRange.formatcondition.formula1 = "="""

I've reversed the conditions where the letter 'x' will meet the format
conditions. In both cases the conditional formatting does what I want but
when testing I keep getting FALSE as having met the condition. In the case
of 'x' the testrange.value is "x" and the testrange.formatcond...formula1
shows "="x""

Am I missing something?
--
MacGuy

Jim Cone[_2_]

Testing Blank Conditional Formatting
 
Maybe...
cfstatus = ActiveSheet.Evaluate(Range("testrange").FormatCond itions(1).Formula1)
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"MacGuy"
wrote in message
I'm having a problem testing for a blank cell with conditional formatting.

I'm looping through a range of cells and when I get to a cell that I know
should evaluate to TRUE for having met the conditional format it is returning
false. The conditional format is when cell value is equal to blank (="")
then format cell with fill color.
cfStatus = testRange.Value = testRange.FormatConditions.Formula1
where testRange.value is blank and testRange.formatcondition.formula1 = "="""
I've reversed the conditions where the letter 'x' will meet the format
conditions. In both cases the conditional formatting does what I want but
when testing I keep getting FALSE as having met the condition. In the case
of 'x' the testrange.value is "x" and the testrange.formatcond...formula1
shows "="x""
Am I missing something?
--
MacGuy


All times are GMT +1. The time now is 08:32 PM.

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