I am trying to populate a ListBox in a UserForm with all the open workbooks on a desktop.
Here is what I have so far. I think I'm getting caught at the ".AddItems" portion.
Any and all help is greatly appreciated.
Private Sub CommandButton1_Click()
WorkbookChoiceUserForm.Show
End Sub
Private Sub UserForm_Initialize()
Dim wb As Workbook
Dim wbs As Workbooks
Dim wbText As String
Set wbs = Application.Workbooks
'Fill WkbkListBox
With WkbkListBox
For Each wb In wbs
wbText = wb.Name
WkbkListBox.AddItem wbText
Next wb
End With
End Sub
Private Sub ContinueButton_Click()
Dim wbChoice As Workbook
wbChoice = WkbkListBox.Value
'Wanted to check my work, but not getting this far yet.
Cells(1, 1).Value = wbChoice
End Sub
Bookmarks