Re : Un Probleme avec FinDates
bonjour Said
une solution,mais si tu veux toutes les dates de stopdate avec il faut faire autrement
Private Sub CommandButton1_Click()
Dim startRow As Integer, stopRow As Integer, d1 As Range, d2 As Range
Dim firstAddress As String
On Error GoTo message
If Not IsDate(StartDate) Then
MsgBox "Veuillez entrer Une Date Svp"
StartDate.SetFocus
Exit Sub
End If
If Not IsDate(StopDate) Then
MsgBox "une date de fin Svp"
StopDate.SetFocus
Exit Sub
End If
On Error Resume Next
Set d1 = Sheets("BD").Cells.Find(What:=CDate(StartDate), After:=Range("A1"), LookIn:=xlFormulas _
, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
If Not d1 Is Nothing Then startRow = d1.Row
On Error Resume Next
Set d2 = Sheets("BD").Cells.Find(What:=CDate(StopDate), After:=Range("A1"), LookIn:=xlFormulas _
, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
On Error GoTo 0
If Not d2 Is Nothing Then stopRow = d2.Row
Sheets("BD").Select
Sheets("BD").Range(Cells(startRow, 1), Cells(stopRow, 8)).Copy _
Destination:=Sheets("CONSULT").Range("A15")
'Sheets("CONSULT").Select
''Unload DlgFind
'UserForm3.Show
'End
'message:
'MsgBox "Date non valide verifier les dates de votre saisie svp", vbInformation, ("Attention")
'End If
End Sub
à bientôt