View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Populate ComboBox with Worksheet Names

Your welcome and thanks for the feedback

"Allen" wrote:

That did the trick, thank you so much!


"Mike H" wrote:

Hi,

Try this

Private Sub UserForm_Initialize()
For x = 1 To Worksheets.Count
ComboBox1.AddItem Sheets(x).Name
Next
End Sub

Mike

"Allen" wrote:

I'm trying to populate a combobox in a userform with the names of the
worksheets in my spreadsheet.

I'm guessing I'll just need to put it in a userform_initialize statement
with a For Each / Next loop, but am having trouble getting it to work.

Any syntax suggestions are much appreciated! Thanks