Thread
:
Conditional Formatting
View Single Post
#
2
Posted to microsoft.public.excel.programming
Nick Hodge
external usenet poster
Posts: 1,173
Conditional Formatting
Brain
You need to use the FormatCondition object. Hopefully the code below will
help, it looks for the Interior property of the first FormatCondition(1)
object in the range A1 and prints it to the immediate window.
Sub Getconditionalformatprops()
Dim fmtCondition As FormatCondition
Dim IntColor As Integer
Set fmtCondition = Range("A1").FormatConditions(1)
IntColor = fmtCondition.Interior.ColorIndex
Debug.Print IntColor
End Sub
--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS
"wardides" wrote in message
...
I have columns in excel that get formatted based on conditional
formatting.
e.g. if cell G1 contains "1" then cell g2 is changed from being
automatic colour to being Blue text on grey background.
The Blue text is colorindex 5.
However if the conditional formatting is applied and I select the cell
in the
VB
code the activecell.font.colorindex still returns the default
colour rather than the current formatted colour.
I need to check if the cell is a different font and if so skip it so is
there any way to get the font with the conditional formatting ?
Regards
Brian
--
wardides
------------------------------------------------------------------------
wardides's Profile:
http://www.excelforum.com/member.php...o&userid=15022
View this thread:
http://www.excelforum.com/showthread...hreadid=277307
Reply With Quote
Nick Hodge
View Public Profile
Find all posts by Nick Hodge