Private Sub UserForm_Initialize()
' Combobox2
With Me.ComboBox2
.Style = fmStyleDropDownList
.AddItem "Florajet"
.AddItem "Entrefleuriste"
.AddItem "Eurofloriste"
End With
If TextBox14 = "" Then TextBox14.Value = "xxxxx"
If TextBox9 = "" Then TextBox9.Value = "xxxxx"
If TextBox10 = "" Then TextBox10.Value = "xxxxx"
End Sub
'Ajouter
Private Sub CommandButton1_Click()
Dim t() As Variant, i As Byte
If ComboBox2.ListIndex > -1 Then
t = Array(ComboBox2.Text, "Récap")
For i = 0 To 1
With Sheets(t(i))
If TextBox14.Value = "" Then
'Label243.Visible = True
Exit Sub
End If
.Range("A9:K9").Insert Shift:=xlDown, CopyOrigin:=xlFormatFromRightOrBelow
.Cells(9, 2) = TextBox1.Value ' Nom
.Cells(9, 3) = TextBox2.Value ' Prénom
.Cells(9, 5) = TextBox5.Value ' Adresse
.Cells(9, 7) = TextBox7.Value ' Ville
.Cells(9, 6) = TextBox6.Value ' C.P
.Cells(9, 8) = TextBox8.Value ' Tel
.Cells(9, 4) = TextBox3.Value ' Date
.Cells(9, 1) = TextBox4.Value ' N° Cde
.Cells(9, 9) = TextBox9.Value 'Montant
.Cells(9, 10) = TextBox10.Value 'Frais
.Cells(9, 11) = TextBox11.Value ' T.T.C
.Cells(9, 12) = TextBox14.Value ' Transmetteur
End With
Next i
TextBox3 = "" ' Nom
TextBox4 = "" ' Prénom
TextBox5 = "" ' Adresse
TextBox7 = "" ' Ville
TextBox6 = "" ' C.P
TextBox8 = "" ' Tel
TextBox1 = "" ' Date
TextBox2 = "" ' N° Cde
TextBox9 = "" ' Montant
TextBox10 = "" ' Frais
TextBox11 = "" ' T.T.C
ComboBox2.ListIndex = -1
Else
MsgBox "Choisir un 'Onglet' !"
'MsgBox "Remplir combobox2' !"
End If
End Sub