I have a single-column multiselect enabled listbox that populates with data from a worksheet called "Testing". I would like to copy all the selected values in the listbox to column AG on another worksheet called "Admin" when the command button "OK" is pressed. Thanks in advance for any help!
I was trying using this code, but I keep getting a 438 run-time error (object doesn't support this property or method).
(This listbox is named ListBox1, the command button is CommandButtonYes. Very creative names, I know...)
I was trying using this code, but I keep getting a 438 run-time error (object doesn't support this property or method).
(This listbox is named ListBox1, the command button is CommandButtonYes. Very creative names, I know...)
Code:
Private Sub CommandButtonYes_Click()
Dim Thing1 As Long
With Application.ActiveSheet.ListBox1.List
For Thing1 = 0 To .ListCount - 1
If .Selected(Thing1) Then
.List(Thing1, 0).Copy Destination:=Sheets("Admin").Cells(Cells.Rows.Count, "AG").Offset(1, 0)
End If
Next Thing1
End With
End Sub