Hello Crispie38,
Here is an example. The UserForm has a ListBox, and a CommandButton. The ListBox name is ListBox1 and the CommandButton is named CommandButton1. The code loads the ListBox1 with 10 rows and 4 columns. CommandButton1 transfers the contents to the ActiveSheet range "A1:D10".
Private Sub CommandButton1_Click()
ActiveSheet.Range("A1:D10") = ListBox1.List()
End Sub
Private Sub UserForm_Initialize()
With ListBox1
.Clear
.ColumnCount = 4
For R = 0 To 9
.AddItem
.List(R, 0) = "Row " & R
For C = 1 To 3
.List(R, C) = "Column " & C
Next C
Next R
End With
End Sub
Sincerely,
Leith Ross
Bookmarks