Private Sub CommandButton1_Click()
Dim TF() As Variant
Dim I As Byte
If Me.OptionButton1.Value = True Then
ReDim Preserve TF(1 To 1)
TF(1) = ActiveSheet.Index
End If
If Me.OptionButton2.Value = True Then
ReDim Preserve TF(1 To Sheets.Count)
For I = 1 To Sheets.Count: TF(I) = I: Next I
End If
If Me.OptionButton3.Value = True Then
ReDim Preserve TF(1 To 1)
TF(1) = Sheets(Me.ComboBox3.Value).Index
End If
If TextBox1.Value = "" Then
MsgBox "Vous devez écrire une valeur", vbCritical, Application.Name
TextBox1.SetFocus
Exit Sub
End If
If ComboBox1.Value = "" Then
MsgBox "Vous devez sélectionner une valeur", vbCritical, Application.Name
ComboBox1.SetFocus
Exit Sub
End If
For I = 1 To UBound(TF)
'rechercher le texte de la Textbox1 dans la colonne de la Combobox2 de l'onglet(I)
Next I
Unload Me
End Sub