Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ComboBox Problem
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
ComboBox Problem
Hi,
Your code should be on workbook Open not in activate. -- JP http://www.solutionsvba.com "Tressa" <- wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
ComboBox Problem
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. -- sb "Tressa" <- wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ComboBox problem | Excel Discussion (Misc queries) | |||
Combobox problem in protected sheet | Excel Discussion (Misc queries) | |||
Problem Using Delete Key Because of Combobox | Excel Discussion (Misc queries) | |||
Strange problem with a combobox and ListFillRange | Excel Discussion (Misc queries) | |||
Excel combobox problem | Excel Discussion (Misc queries) |