Bonjour à tous,
J'ai créé un petit tableau pour gérer mes congélateurs à l'aide d'un formulaire, je bloque sur une macro dans mon UserForm.
Voici une capture de mon tableau:

Lorsque je rempli mon formulaire, toutes les colonnes se remplissent sauf la colonne B
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Private Sub CommandButton1_Click()If Sheets("Gestion congélateur").Range("B4") = "" Then
Sheets("Gestion congélateur").Range("B4") = ComboBox1
Else
Sheets("Gestion congélateur").ListObjects(1).ListRows.Add
End If
Dlt = Sheets("Gestion congélateur").Range("D1048576").End(xlUp).Row
Sheets("Gestion congélateur").Range("B" & Dlt) = ComboBox1
Sheets("Gestion congélateur").Range("B" & Dlt) = ComboBox2
Sheets("Gestion congélateur").Range("B" & Dlt) = ComboBox3
Sheets("Gestion congélateur").Range("B" & Dlt) = ComboBox4
Sheets("Gestion congélateur").Range("B" & Dlt) = ComboBox5
Sheets("Gestion congélateur").Range("B" & Dlt) = ComboBox6
Sheets("Gestion congélateur").Range("C" & Dlt) = TextBox1
Sheets("Gestion congélateur").Range("E" & Dlt) = TextBox2
Sheets("Gestion congélateur").Range("F" & Dlt) = TextBox3
Sheets("Gestion congélateur").Range("G" & Dlt) = ComboBox7
Unload UserForm1
End Sub |
Bien sûr, dans l'Userform, j'ai créé des comboBox1 ComboBox2 etc. comme ceci :
1 2 3 4 5 6 7 8
| Private Sub UserForm_Initialize()TextBox2.Text = "jj/mm/aaaa"
With ComboBox1
.AddItem "Abats"
.AddItem "Agneau"
.AddItem "Boeuf"
etc.
End with
End Sub |
D'ou vient le problème ? de la deuxième ligne de code ? :
Sheets("Gestion congélateur").Range("B4") = ComboBox1
il faudrait que j'y ajoute ComboBox2, ComboBox3 etc.
si oui, séparé par des virgules ou avec le signe = ? Ou le problème vient-il d'ailleurs ?
Voici une capture de L'UserForm : Merci à tous pour votre aide
Partager