Heello, first time here, need some help to avoid repetitive code.
I need to change String and color for conditionnal formatting through loop, need to increment "item2" loop (one time) each time "item1" loop, problem is "item2" will loop x times before "item1" can increment the loop
I hope I made myself understood, I'm a bit stuck, sorry for my low IQ :) Thanks for any answers
        Dim item1 As Variant
        Dim strNames(1 To 3) As String
        strNames(1) = "Name1"
        strNames(2) = "Name2"
        strNames(3) = "Name3"
        Dim item2 As Variant
        Dim strColors(1 To 3) As String
        strColors(1) = 15773696
        strColors(2) = 5296274
        strColors(3) = 5287936
        
        For Each item1 In strNames
        
        Range("A4:N4,A9:N9,A14:N14,A19:N19,A24:N24,A29:N29").Select
        Selection.FormatConditions.Add Type:=xlTextString, String:=item1, _
            TextOperator:=xlContains
        Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
        With Selection.FormatConditions(1).Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        For Each item2 In strColors
        .Color = item2
        .TintAndShade = 0
        .PatternTintAndShade = 0
        End With
        Selection.FormatConditions(1).StopIfTrue = False
        
        Next item2
        Next item1
