ComboBox Problem

T

Tressa

Hello-

I have a combobox that is in an excel worksheet. I have code behind the
combobox (shown by view code). However when I exit the workbook and re enter
it the code no longer works. The Combobox just shows the last value picked
and when you click on the down arrow it comes up blank.

I also received a runtime error 424 Object required.
I am not sure what I need to do to make it work. Does anyone have any
suggestions.

code:

Private Sub Worksheet_Activate()
'Sets initial values of each combobox

With ComboBox1
ComboBox1.AddItem "Yes"
ComboBox1.AddItem "No"

End With

End Sub

'This calls this initialization for each combobox
Private Sub ComboBox1_Click()
ComboBox1.DropDown
End Sub
 
S

steve

Tressa,

Some minor changes to your activate code. Put the items in (...)
Private Sub Worksheet_Activate()
'Sets initial values of each combobox

With ComboBox1
.AddItem ("Yes")
.AddItem ("No")
End With

End Sub

I don't know what your initialize code does. It doesn't do anything in my
Excel 97.
 

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

Top