Conditional Formatting Help

A

Ayo

I am trying to do a conditional format on the rngInsitedata range. If the
cell value is past due I want the cell to be Red Fill and font color white.
Please help.

With rngInsitedata
.FormatConditions.Add(xlCellValue, xlEqual,"=Past Due")
With .Borders
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 6
End With
With .Font
.Bold = True
.ColorIndex = 3
End With
End With
 
J

Jacob Skaria

Try the below

Sub Macro()
Dim rngInsiteData As Range
Set rngInsiteData = Range("C1:C10")

With rngInsiteData
..FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=""Past Due"""
..FormatConditions(1).Font.ColorIndex = 2
..FormatConditions(1).Interior.ColorIndex = 3
..FormatConditions(1).Interior.Pattern = xlSolid
End With
End Sub

If this post helps click Yes
 

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