Bonjour,
J'ai un code qui crée édite un userform puis l'ouvre:
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 35 36 37
|
Private Sub Worksheet_Change(ByVal Target As Range)
.
.
.
Dim MaListe As Control, X As Integer, n As Integer
Set MaListe = UserForm1.Controls.Add("Forms.ListBox.1")
With MaListe
For n = 1 To Worksheets("DONNEES").Range("X150000").End(xlUp).Row
.AddItem (Worksheets("DONNEES").Range("X" & n).Value)
.Height = 450
.Width = 150
.MultiSelect = 1
.Visible = True
Next n
End With
UserForm1.Show
.
.
. |
Dans le userform, je cherche à récupérer ces donnée:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
Private Sub CommandButton1_Click()
Dim w As Integer
For w = 1 To Me.Controls("MaListe").ListCount
Worksheets("DONNEES").Cells(w + 2, 26).Value = Me.Controls("MaListe").List(w)
Next w
.
.
. |
Mais ça bloque: Erreur d'exécution '-2147024809 (80070057)': Oblet spécifié introuvable sur la ligne:
Worksheets("DONNEES").Cells(w + 2, 26).Value = Me.Controls("MaListe").List(w)
Je remercie beaucoup ceux qui pourront m'apporter une aide précieuse
Partager