Userform ComboBox Row Source

  • Thread starter Thread starter Brad
  • Start date Start date
B

Brad

Thanks for taking the time to read my question.

I have a user form on which I have a ComboBox. I'd like to have the ComboBox
list the names of all the worksheets in the workbook. I've tried to make the
rowsource a list like "Test1";"Test2" or "Test1","Test2" but no luck.

If I could make the rowsource a string, I could build the string in VBA no
problem and assign the string to the combobox.

Is there a way to do this?

Thanks,

Brad
 
Private Sub UserForm_Initialize()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ComboBox1
.AddItem ws.Name
End With
Next
End Sub
 
Back
Top