Private Sub CommandButton3_Click()
If ComboBox2.ListIndex <> -1 And TextBox3 <> "" Then
Sheets("2016").Cells(ComboBox2.ListIndex + 18, Month("1/" & ComboBox3) + 2) = TextBox3.Value
MsgBox ("Montant ajouté")
ComboBox2.ListIndex = -1
TextBox3 = ""
Else
MsgBox ("Renseignez un fournisseur et un montant")
ComboBox2.ListIndex = -1
TextBox3 = ""
End If
End Sub
'Dans initialize du formulaire tu peux créer les mois aussi de cette façon.
Private Sub UserForm_Initialize()
Dim Mois(1 To 12) As String
Dim i As Integer
For i = 1 To 12
Mois(i) = Format(DateSerial(1, i, 1), "mmmm")
Me.ComboBox1.AddItem Mois(i)
Next i
End Sub