Bonjour,
Débutant en excel VBA et macro, j'ai créée un formulaire via un userform et je souhaiterai que les données soit enregistré dans un tableau.
Petit soucis les données ne s'enregistre pas ligne après ligne mais toujours sur la même ligne en supprimant celle d'avant.
Merci de votre aide.
Private Sub CommandButton1_Click()
If Controls("ComboBox4") = "" Then
MsgBox " Veuillez indiquer le nom d'un technicien ", vbExclamation, _
"ERREUR ... "
Controls("ComboBox4").SetFocus
Else:
ligne_insertion = Sheets("Feuil1").Range("A1").End(xlDown).Row + 1
Sheets("Feuil1").Cells(ligne_insertion, 1) = ComboBox1.Value
Sheets("Feuil1").Cells(ligne_insertion, 2) = ComboBox2.Value
Sheets("Feuil1").Cells(ligne_insertion, 3) = TextBox5.Value
Sheets("Feuil1").Cells(ligne_insertion, 4) = TextBox3.Value
Sheets("Feuil1").Cells(ligne_insertion, 5) = TextBox4.Value
Sheets("Feuil1").Cells(ligne_insertion, 6) = TextBox2.Value
Sheets("Feuil1").Cells(ligne_insertion, 9) = ComboBox3.Value
Sheets("Feuil1").Cells(ligne_insertion, 10) = IIf(OptionButton6, "1", "0")
Sheets("Feuil1").Cells(ligne_insertion, 11) = IIf(OptionButton8, "1", "0")
Sheets("Feuil1").Cells(ligne_insertion, 12) = IIf(OptionButton10, "1", "0")
Sheets("Feuil1").Cells(ligne_insertion, 13) = IIf(OptionButton11, "1", "0")
Sheets("Feuil1").Cells(ligne_insertion, 14) = IIf(OptionButton13, "1", "0")
Sheets("Feuil1").Cells(ligne_insertion, 15) = IIf(OptionButton15, "1", "0")
Sheets("Feuil1").Cells(ligne_insertion, 16) = IIf(OptionButton4, "Textbox2", "0")
Unload Me
End If
End Sub