1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
Sub date_6()
Dim X As Variant
Dim Cel As Range
Application.ScreenUpdating = False
X = Application.InputBox("Année de la date", "ANNÉE", Type:=1)
If X = False Then Exit Sub
Worksheets("feuil2").Cells.ClearContents 'efface cellules feuille
Set Cel = Sheets("Feuil1").UsedRange.Find(X, lookat:=xlPart)
If Not Cel Is Nothing Then
PA = Cel.Address
Lig = 1 'ligne de depart pour feuil2
Do
Cel.Interior.ColorIndex = 3
Sheets("Feuil2").Activate
Cel.EntireRow.Copy
Lig = Lig + 1 '+1 pour donnee suivante
Cells(Lig, 1).Select
ActiveSheet.Paste
Set Cel = Sheets("Feuil1").UsedRange.FindNext(Cel)
Loop While Not Cel Is Nothing And Cel.Address <> PA
End If
Application.ScreenUpdating = True
End Sub |
Partager