Option Explicit
Public cell
Sub Trouve_Triplet_Colonnes()
For Each cell In Selection
cell.Select
Trouve_Triplet_Colonne_Active
Next
End Sub
Sub Trouve_Triplet_Colonne_Active()
'Paritec
Dim i&, a, b, c, aa
'aa = Activesheet.Range("C2:C" & Activesheet.Range("C" & Rows.Count).End(xlUp).Row)
aa = ActiveSheet.Range(Cells(2, ActiveCell.Column), Cells(Cells(Rows.Count, ActiveCell.Column).End(xlUp).Row, ActiveCell.Column))
With ActiveSheet
For i = 1 To UBound(aa) Step 3
For a = i + 3 To UBound(aa) Step 3
If aa(i, 1) = aa(a, 1) And aa(i + 1, 1) = aa(a + 1, 1) And aa(i + 2, 1) = aa(a + 2, 1) Then
'.Range(.Cells(i + 1, 3), .Cells(i + 3, 3)).Interior.ColorIndex = 6
'.Range(.Cells(a + 1, 3), .Cells(a + 3, 3)).Interior.ColorIndex = 6
.Range(.Cells(i + 1, ActiveCell.Column), .Cells(i + 3, ActiveCell.Column)).Interior.ColorIndex = 6
.Range(.Cells(a + 1, ActiveCell.Column), .Cells(a + 3, ActiveCell.Column)).Interior.ColorIndex = 6
End If
Next a
Next i
End With
End Sub