assigning sheet names to a combo box


Posted by Mike on January 18, 2002 5:00 PM

how do i assign sheet names to a combo box?



Posted by Bariloche on January 18, 2002 9:48 PM

Mike,

Given that you have a userform called UserForm1 and a combobox called ComboBox1, the following should illustrate the solution to your question:


Sub ComboWithSheetName()
Dim sht As Worksheet

For Each sht In Worksheets
UserForm1.ComboBox1.AddItem sht.Name
Next sht

UserForm1.Show

End Sub


Substitute your actual names, of course.


enjoy