Conditional Formatting Help

  • Thread starter Thread starter Ayo
  • Start date Start date
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
 
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
 
Back
Top