Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to obtain the selected value from a combo box in Excel?

Status
Not open for further replies.

ultra2

Programmer
Jun 26, 2005
46
HU
How to obtain the selected value from a combo box in Excel?
I have a combo box on an excel worksheet, how to write a makro (event handler) to change a cell value as a user choose a number from the combo?

Sub combo_change()
Cells(1, 10) = combo_value??
End Sub

plz help
 
Try:
Code:
Cells(1, 10) = combo1.value
Hope this helps

HarleyQuinn
---------------------------------
Help us to help you,
read FAQ222-2244 before posting.
 
Cells(1, 10) = combo1.value
error: object required
 
Is your combobox called combo1???

HarleyQuinn
---------------------------------
Help us to help you,
read FAQ222-2244 before posting.
 
The default name for a combobox control in Excel is ComboBox1.

Private Sub ComboBox1_Change()
Range("a10") = ComboBox1.Value
End Sub

In future please note you do better with VBA questions in the VBA forum, that's forum707

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top