1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| Option Explicit
Sub balaie_filtre()
Dim derlign As Long
Dim laplage As Range, c As Range
Dim n As Long
Dim tablo() As Variant
Dim j As Long
With Feuil1
derlign = .Cells(.Rows.Count, 1).End(xlUp).Row
Set laplage = .Range("A2:A" & derlign).SpecialCells(xlCellTypeVisible)
End With
n = 0
For Each c In laplage
n = n + 1
ReDim Preserve tablo(1 To 2, 1 To n)
tablo(1, n) = c.Row
tablo(2, n) = c.Value
Next c
For j = LBound(tablo, 2) To UBound(tablo, 2) - 1
If tablo(2, j) <> tablo(2, j + 1) Then
'Ici Traitement spécial
MsgBox Prompt:="Valeur - " & tablo(2, j) & " - différente à la ligne " & tablo(1, j)
End If
Next j
Erase tablo
Set laplage = Nothing
End Sub |
Partager