Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ComboBox problem hoyos Excel Discussion (Misc queries) 4 December 10th 09 11:16 AM
Combobox problem in protected sheet Oguz Excel Discussion (Misc queries) 0 March 27th 08 11:26 AM
Problem Using Delete Key Because of Combobox Joseph Fletcher Excel Discussion (Misc queries) 11 February 23rd 07 01:45 PM
Strange problem with a combobox and ListFillRange teddyk Excel Discussion (Misc queries) 1 August 7th 06 09:16 PM
Excel combobox problem aoeui Excel Discussion (Misc queries) 2 August 25th 05 02:07 AM


All times are GMT +1. The time now is 05:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"