Sub searchaploc()
Sub searchaploc()
Dim searchdate As Range
Dim ligne_vide_dataff As Variant
Dim datestrg As String
Dim u, v, u2, v2
Dim i As Integer
With Sheets("Data2").Range("B2:B6000")
Sheets("AP locales-autres plans").Cells(503, 1).NumberFormat = "dd/mm/yyyy"
datestrg = Sheets("AP locales-autres plans").Cells(503, 1).value
Set searchdate = .Find(What:=datestrg, LookIn:=xlFormulas, LookAt:=xlWhole, MatchCase:=False)
If Not searchdate Is Nothing Then
u = searchdate.Row
ligne_vide_dataff = Sheets("Dataff").Range("A65536").End(xlUp).Row + 1
u2 = Sheets("Dataff").Cells(ligne_vide_dataff, 1).Row
Do
Sheets("Dataff").Cells(u2, 1).value = Sheets("data2").Cells(u, 1).value
Sheets("Dataff").Cells(u2, 2).value = Sheets("data2").Cells(u, 2).value
Sheets("Dataff").Cells(u2, 3).value = Sheets("data2").Cells(u, 3).value
Sheets("Dataff").Cells(u2, 4).value = Sheets("data2").Cells(u, 4).value
Sheets("Dataff").Cells(u2, 5).value = Sheets("data2").Cells(u, 7).value
Set searchdate = .FindNext(searchdate)
Loop While Not searchdate Is Nothing
End If
End With
End Sub
End Sub