Renvoyer valeurs d'un formulaire VBA sur excel de maniere incrémentale
Bonjour à tous,
J'essaie éperduement depuis plusieurs heures d'enregistrer des valeurs d'un formulaire VBA sur un fichier Excel de sorte que chaque fois que j'enregistre de nouvelles valeurs, celles-ci soient enregistrées dans un tableau sur la colonne suivante.
Voici mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| Sub CommandButton1_Click()
IndexOnglet1 = ComboBox1.ListIndex
Q1 = ComboBox1.List(IndexOnglet1)
IndexOnglet2 = ComboBox9.ListIndex
Q2 = ComboBox9.List(IndexOnglet2)
IndexOnglet3 = ComboBox10.ListIndex
Q3 = ComboBox10.List(IndexOnglet3)
IndexOnglet4 = ComboBox11.ListIndex
Q4 = ComboBox11.List(IndexOnglet4)
IndexOnglet5 = ComboBox5.ListIndex
Q5 = ComboBox5.List(IndexOnglet5)
IndexOnglet6 = ComboBox12.ListIndex
Q6 = ComboBox12.List(IndexOnglet6)
IndexOnglet7 = ComboBox13.ListIndex
Q7 = ComboBox13.List(IndexOnglet7)
IndexOnglet8 = ComboBox14.ListIndex
Q8 = ComboBox14.List(IndxOnglet8)
Dim i As Integer, FL1 As Worksheet
Set FL1 = Worksheets("Feuil1")
i = FL1.Cells(1, 1).End(xlUp).Row + 1
FL1.Cells(2, i).Value = Q1
FL1.Cells(3, i).Value = Q2
FL1.Cells(4, i).Value = Q3
FL1.Cells(5, i).Value = Q4
FL1.Cells(6, i).Value = TextBox1
FL1.Cells(7, i).Value = Q5
FL1.Cells(8, i).Value = Q6
FL1.Cells(9, i).Value = Q7
FL1.Cells(10, i).Value = Q8
FL1.Cells(11, i).Value = TextBox2
FL1.Cells(12, i).Value = TextBox3
MsgBox "Questionnaire enregistré"
End Sub |
Voila, merci d'avance