try this
Sub a()
Dim s As Worksheet
For Each s In Worksheets
UserForm1.ListBox2.AddItem s.Name
Next s
UserForm1.Show
End Sub
On Sat, Nov 20, 2010 at 4:10 AM, scaz wrote:
> I'm having trouble adding the names of my worksheets to a listbox in a
> userform I have created.
>
> Dim item
> Dim frm A
I'm having trouble adding the names of my worksheets to a listbox in a
userform I have created.
Dim item
Dim frm As New BatchPrintForm
For Each item In ThisWorkbook.Sheets
With frm.SheetList
.AddItem (item.Name)
End With
Next item
If I put "MsgBox(item.Name)" after the line that