Eloise T
Active Member
I am trying to create a macro to reset a Conditional Format that looks for "OOW" in Column A and upon finding that partial string sets the font and background so it stands out. I believe the problem lies in the 7th line of the VBA code: Formula1:="=OR($A3=""OOW "")"
The Conditional Format is correctly set up as follows, but the VBA macro does not conform to the correct CF set up. Any help to adjust the VBA macro code would be appreciated....and Thank you in advance.
The Conditional Format is correctly set up as follows, but the VBA macro does not conform to the correct CF set up. Any help to adjust the VBA macro code would be appreciated....and Thank you in advance.
Code:
Sub Conditional_Format_Reset()
Dim Ws As Worksheet
For Each Ws In ThisWorkbook.Worksheets
If Ws.Cells(Rows.Count, "A").End(xlUp).Row > 2 Then
With Ws.Range("A3:A7503")
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="=OR($A3=""OOW "")"
.FormatConditions(.FormatConditions.Count).Font.Bold = True 'Bold font
.FormatConditions(.FormatConditions.Count).Font.ColorIndex = 7 'Magenta font
.FormatConditions(.FormatConditions.Count).Interior.ColorIndex = 4 'Green background
.FormatConditions(.FormatConditions.Count).StopIfTrue = False
End With
End If 'Concludes: If Ws.Cells(Rows.Count, "A").End(xlUp).Row > 2 Then
Next 'Concludes: For Each ws In ThisWorkbook.Worksheets
Beep
End Sub