This is part of a larger macro to update several workbooks.
Some Worksheet names have numbers only and some letters only.
I cannot figure out how to loop through each worksheet named with numbers and update the conditional formatting below.
Some Worksheet names have numbers only and some letters only.
I cannot figure out how to loop through each worksheet named with numbers and update the conditional formatting below.
VBA Code:
Sub test2()
Dim sht As Worksheet
'ADD CONDITIONAL FORMAT LOOP
For Each sht In ActiveWorkbook.Worksheets
If sht.Name <> sht.Name And IsNumeric(sht.Name) Then
Range("$W$72:$X$121").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=""YES"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 49407
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
End If
Next sht
' END CONDITIONAL FORMATTING
End Sub