With Selection.Interior ColorIndex = 3 ' Manque le . en tête Pattern = xlSolid ' de ces 2 lignes End With
Sub MacroVinBlanc() Dim Cell_1 As Range Dim Cell_2 As Range ' Cellules de la feuille 1 For Each Cell_1 In Sheets("Feuille1").Range("B6:B20000") ' Cellules de la feuille 2 For Each Cell_2 In Sheets("Feuille2").Range("C2:C41") ' Si identiques If Cell_1.Value = Cell_2.Value Then ' Zoli coloriage With Cell_1.Interior ColorIndex = 3 Pattern = xlSolid End With ' Pas la peine de continuer Exit For End If Next Next End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionSub Flagship() Dim i As Integer Dim j As Integer For i = 6 To 2000 For j = 2 To 40 If Worksheets("Product Board").Range("B" + CStr(i)).Value = Worksheets("FlagShip Products").Range("C" + CStr(j)).Value Then Worksheets("Product Board").Activate Worksheets("Product Board").Range("B" + CStr(i)).Select With Selection.Interior .ColorIndex = 40 .Pattern = xlSolid End With End If Next j Next i End Sub