Private Sub CommandButton1_Click()
Dim Lig&, Col&, f As Worksheet, Z, plg As Range
If ComboBox1 = "" Then
MsgBox "Vous devez ABSOLUMENT indiquer le rayon !", vbExclamation, _
"ERREUR ... le rayon SVP !"
ComboBox1.SetFocus
If ComboBox2 = "" Then
MsgBox "Vous devez ABSOLUMENT indiquer le fournisseur !", vbExclamation, _
"ERREUR ... le fournisseur SVP !"
ComboBox2.SetFocus
Exit Sub
End If
End If
Set f = Sheets(ComboBox1.Value)
Set plg = f.Range("B9:B47")
Z = Application.Match(CLng(CDate(TextBox4)), plg, 0)
Lig = Z + 8
Col = ComboBox2.ListIndex + 9
'pour test
'MsgBox f.Cells(Lig, Col).Address
f.Cells(Lig, Col) = TextBox1
Unload Me
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
Me.TextBox4 = Date
End Sub