Sub TestDateFind()
Dim x, d As Range, L As Long, C As Range, Li As Long
Application.ScreenUpdating = False
x = InputBox("entrer une date entre le 21/01/2012 et le 30/03/2013")
If x = "" Then Exit Sub
Range("rapport!A2:E100").Clear
Set d = [PlageDates2]
Range("rapport!E2") = CDate(x)
For L = 2 To Range("test_format_date!C65536").End(xlUp).Row 'les formats
d.NumberFormat = Range("test_format_date!C" & L).NumberFormat
On Error Resume Next
'** içi pour tester avec find
'avec LookAt:=xlWhole
With Worksheets("RechercheFeuil")
Set C = .Cells.Find(What:=CDate(x), After:=.Range("A1"), LookIn:=xlFormulas _
, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
End With
'avec LookAt:=xlPart
'With Worksheets("RechercheFeuil")
' Set C = .Cells.Find(What:=CDate(x), After:=.Range("A1"), LookIn:=xlFormulas _
' , LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
'End With
'**
On Error GoTo 0
If Not C Is Nothing Then
Li = Range("rapport!A65536").End(xlUp).Row + 1
Range("rapport!A" & Li) = Range("test_format_date!C" & L).NumberFormat
Range("rapport!B" & Li) = d.Cells(C.Row, 1)
Range("rapport!B" & Li).NumberFormat = Range("test_format_date!C" & L).NumberFormat
Range("rapport!C" & Li) = d.Cells(C.Row, C.Column)
Range("rapport!C" & Li).NumberFormat = "dd/mm/yyyy"
If Range("rapport!C" & Li).Value <> Range("DateE").Value Then Range("rapport!C" & Li).Interior.ColorIndex = 4
Range("rapport!D" & Li) = "L:" & C.Row & ",C:" & C.Column
Else
Li = Range("rapport!A65536").End(xlUp).Row + 1
Range("rapport!A" & Li) = Range("test_format_date!C" & L).NumberFormat
Range("rapport!B" & Li) = CDate(x)
Range("rapport!B" & Li).NumberFormat = Range("test_format_date!C" & L).NumberFormat
Range("rapport!C" & Li) = "pas trouvé"
Range("rapport!C" & Li).Interior.ColorIndex = 4
End If
Next L
Worksheets("rapport").Activate
Application.ScreenUpdating = True
End Sub