1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| message = CVar(Format(CDate(LaDate), "dd/mm/yyyy"))
Plage = Cells(1, 1).CurrentRegion.Address(RowAbsolute:=False, _
ColumnAbsolute:=False)
NouvelleLigne = Worksheets("Feuil2").Cells(65535, 1).End(xlUp).Row + 1
Do
With Worksheets("Feuil1").Range(Plage)
Set CestLa = .Find(message, LookIn:=xlValues, LookAt:=xlPart)
If Not CestLa Is Nothing Then
Rows(Range(CestLa.Address).Row).EntireRow.Copy Worksheets("Feuil2").Rows(NouvelleLigne)
Rows(Range(CestLa.Address).Row).Delete Shift:=xlUp
Else
MsgBox "Date inexistante"
Exit Do 'sortie de boucle si plus de correspondance
End If
End With
NouvelleLigne = Worksheets("Feuil2").Cells(65535, 1).End(xlUp).Row + 1
Plage = Cells(1, 1).CurrentRegion.Address
Loop While Not CestLa Is Nothing
Set CestLa = Nothing |