Option Explicit
Private Sub UserForm_Initialize()
ComboBox1.ColumnCount = 1 'Pour la liste déroulante Civilité
ComboBox1.List() = Array("M.", "Mme", "Mlle")
Workbooks.Open ("C:\fichierclient.xlsx") 'ouvrir classeur fichier client
End Sub
Private Sub CommandButton1_Click()
Dim DERLIGNE As Long
With Application.Workbooks("fichierclient.xlsx").Worksheets("feuil1")
DERLIGNE = .Range("A" & Rows.Count).End(xlUp).Row + 1
.Cells(DERLIGNE, 1) = TextBox1 'code client
.Cells(DERLIGNE, 2) = ComboBox1 'civilite
.Cells(DERLIGNE, 3) = TextBox3 'nom
.Cells(DERLIGNE, 4) = TextBox2 'prenom
.Cells(DERLIGNE, 5) = TextBox5 'adresse
.Cells(DERLIGNE, 6) = TextBox6 'code postal
.Cells(DERLIGNE, 7) = TextBox7 'ville
.Cells(DERLIGNE, 8) = TextBox8 'telephone
.Cells(DERLIGNE, 9) = TextBox9 'EMAIL
End With
End Sub