Bonjour le forum,
J'ai une listbox avec plusieurs lignes et colonnes et je voudrai copier le contenu sur une feuille excel.
voici mon code
Private Sub CommandButton2_Click()
Dim xlig As Long
Workbooks.Open Filename:= _
ThisWorkbook.Path & "\bilan.xls"
Windows("bilan.xls").Activate
xlig = Range("a65536").End(xlUp).Row + 1
Range("B5") = CDate(Label2)
For x = 0 To XXXXXXXXXXX JE PENSE QUE PROBLEME EST LA
Cells(xlig, 1) = UserForm18.ListBox1.List(x, 0)
Cells(xlig, 2) = UserForm18.ListBox1.List(x, 1)
Cells(xlig, 3) = UserForm18.ListBox1.List(x, 2)
Cells(xlig, 4) = UserForm18.ListBox1.List(x, 3)
Cells(xlig, 5) = UserForm18.ListBox1.List(x, 4)
Cells(xlig, 6) = UserForm18.ListBox1.List(x, 5)
Cells(xlig, 7) = UserForm18.ListBox1.List(x, 6)
Cells(xlig, 8) = UserForm18.ListBox1.List(x, 7)
Cells(xlig, 9) = UserForm18.ListBox1.List(x, 8)
x = x + 1
Next x
ActiveWorkbook.Save
End Sub
merci
J'ai une listbox avec plusieurs lignes et colonnes et je voudrai copier le contenu sur une feuille excel.
voici mon code
Private Sub CommandButton2_Click()
Dim xlig As Long
Workbooks.Open Filename:= _
ThisWorkbook.Path & "\bilan.xls"
Windows("bilan.xls").Activate
xlig = Range("a65536").End(xlUp).Row + 1
Range("B5") = CDate(Label2)
For x = 0 To XXXXXXXXXXX JE PENSE QUE PROBLEME EST LA
Cells(xlig, 1) = UserForm18.ListBox1.List(x, 0)
Cells(xlig, 2) = UserForm18.ListBox1.List(x, 1)
Cells(xlig, 3) = UserForm18.ListBox1.List(x, 2)
Cells(xlig, 4) = UserForm18.ListBox1.List(x, 3)
Cells(xlig, 5) = UserForm18.ListBox1.List(x, 4)
Cells(xlig, 6) = UserForm18.ListBox1.List(x, 5)
Cells(xlig, 7) = UserForm18.ListBox1.List(x, 6)
Cells(xlig, 8) = UserForm18.ListBox1.List(x, 7)
Cells(xlig, 9) = UserForm18.ListBox1.List(x, 8)
x = x + 1
Next x
ActiveWorkbook.Save
End Sub
merci