Setup ComboBox when open workbook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I want to fill a ComboBox with items when I open the Workbook.
But I don't want to take the items from cells in the worksheet.
So I tried these lines:

Private Sub Workbook_Open()
ComboBox1.List = Array("First", "Second", "Third", "Forth")
End Sub

But this does not work.
What is missing.

Thanks in advance,
/Sören
 
It probably doesn't know where the combo box is

Private Sub Workbook_Open()
Worksheets("Sheet1").ComboBox1.List = Array("Item1", "Item2", "Item3")
End Sub
 
Hi Soren

If your combobox is located on sheet1 say, then try prefixing the
combobox statement with the location ie:

Private Sub Workbook_Open()
Sheets("Sheet1").ComboBox1.List = Array("First", "Second",
"Third", "Forth")
End Sub

Hope this helps!

Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top