1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Sub filtre2()
Dim j As Integer
Dim X As Variant
Dim Cel As Range
X = Application.InputBox("Année de la date", "ANNÉE", Type:=1)
If X = False Then Exit Sub
Set Cel = Sheets("Feuil1").UsedRange.Find(X, lookat:=xlPart)
If Not Cel Is Nothing Then
PA = Cel.Address
j = 1
Do
Cel.Interior.ColorIndex = 3
Sheets("Feuil2").Range("A" & j).Value = Cel.Value
j = j + 1
Set Cel = Sheets("Feuil1").UsedRange.FindNext(Cel)
Loop While Not Cel Is Nothing And Cel.Address <> PA
End If
End Sub |