• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

vba conditional format

I am trying to set a conditional format based on a range that contains today's date. any one know the syntax of format conditions?
 
The best way to learn/see would be to record a macro of you setting the conditional formats in the worksheet. That should give you the basic structure you need to adapt it into your regular macro.
 
Really?

Recorded 10 seconds ago:

[pre]
Code:
Sub Macro1()
'
' Macro1 Macro
'

'
Range("G3").Select
Cells.FormatConditions.Delete
Range("G3").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=K15<=TODAY()"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent1
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
End Sub
[/pre]
 
Hmmmmmm.

i have been trying all day and everytime I recorded all i would get is the cell i selected and that was it. Now, i just recorded it and it worked.


go figure right!


Thanks!!!
 
Back
Top