Option Explicit
Private Sub CommandButton1_Click()
Dim a As Variant
Dim b As Variant
Dim n As Integer
Dim x As Integer
Dim trouvé As Boolean
If OptionButton1 Then Sheets(OptionButton1.Caption).Select
ActiveSheet.Rows.Hidden = False
For n = 1 To 4
If Controls("Textbox" & n) <> "" Then
For x = 3 To ActiveSheet.Range(Cells(65536, CInt(Controls("Textbox" & n).Tag)).Address).End(xlUp).Row
If Controls("Textbox" & n).Tag = 3 Then
a = CDate(Cells(x, CInt(Controls("Textbox" & n).Tag)))
b = CDate(Controls("Textbox" & n).Value)
Else
a = CStr(Cells(x, CInt(Controls("Textbox" & n).Tag)))
b = Controls("Textbox" & n).Value
End If
If a <> b Then
ActiveSheet.Rows(x).Hidden = True
Else
trouvé = True
End If
Next x
End If
Next n
If Not trouvé Then MsgBox ("Pas trouvé")
End Sub