I want to clear and reset the conditional formatting on certain ListObjects in my work book. How do I create an array so that I can use for loops to apply the formatting. This was originally written to apply to the whole sheet, but now I want to restrict the routine to a table.
Here is my code:
Sub Reset()
'Dim ws As Worksheet
Dim lo As Variant
Dim ArrTab As Variant
Dim ws As Variant
Dim Item As Variant
Dim ArrGreen As Variant
ArrTab = Array("Dept1710", "Dept1711", "Dept1713", "Dept1715", "Dept1716", "Dept1717")
ArrGreen = Worksheets("Drop down").Range("Q14:Q18").Value
For Each lo In ArrTab
lo.Select
Selection.FormatConditions.Delete
For Each Item In ArrGreen
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:=Item
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 5287936
.TintAndShade = 0
End With
Next Item
Next lo
End Sub
ArrTab has all of the table names.