Re : code de recherche ?
voici le code modifié, et ça fonctionne :
Private Sub CommandButton1_Click()
Dim Sh As Worksheet
On Error Resume Next
Set Sh = Sheets(ComboBox1.Value)
If Err Then MsgBox "Feuille introuvable", 48: ComboBox1.DropDown: Exit Sub 'en cas d'entrée manuelle incorrecte
On Error GoTo 0
Sh.Visible = True 'en cas de feuille masquée
Sh.Activate
Dim c As Range, premier As String, i As Long
With ListBox1
.Clear
.ColumnCount = 4
End With
Text = Me.TextBox1
If Text = "" Then Exit Sub
With Range("A2
2" & Range("A65536").End(xlUp).Row)
Set c = .Find(CDate(Me.TextBox1), LookIn:=xlValues, LookAt:=xlPart)
If Not c Is Nothing Then
premier = c.Address
Do
Me.ListBox1.AddItem c.Value
Me.ListBox1.Column(1, i) = c.Offset(0, 1).Value
Me.ListBox1.Column(2, i) = c.Offset(0, 2).Value
Me.ListBox1.Column(3, i) = c.Offset(0, 3).Value
Set c = .FindNext(c)
i = i + 1
Loop While Not c Is Nothing And c.Address <> premier
End If
End With
If i = 0 Then MsgBox "La Date : " & Me.TextBox1 & " n'a pas été trouvée" & vbCrLf & "Modifiez la date", vbCritical, "Erreur :"
End Sub