Can Anyone help me I want to add code to a userform in excel so that a list box on it will display a list of all of the worksheets in an active workbook, Any ideas?
Private Sub UserForm_Initialize()
Dim iCount As Integer
For iCount = 1 To ThisWorkbook.Worksheets.Count
ListBox1.AddItem ThisWorkbook.Worksheets(iCount).Name
Next
End Sub
I've just learned today that by doing this it even lists the hidden sheet left over from my last reply to monk999 on hiding sheets.
I'm having a good day despite my cold having also discovered ms flexigrid
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.