Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the combox in my spreadsheet and have the VBA code running when there
is a change to the value, but I don't know how to refer to the combobox to get the currently selected value |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
worksheets("Sheet1").OleObjects("Combobox1").Objec t.Value
or if you are in the code module for sheet1 (the sheet where the combobox is located) combobox1.Value -- Regards, Tom Ogilvy "Joe" wrote in message ... I have the combox in my spreadsheet and have the VBA code running when there is a change to the value, but I don't know how to refer to the combobox to get the currently selected value |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
My code is in the Modules section tied to the spreadsheet where I have the
function ComboBox1_Change() Neither of the syntaxes you listed work in this context, nor does ActiveSheet.OLEObjects("ComboBox1").Object.Value Any more ideas? "Tom Ogilvy" wrote: worksheets("Sheet1").OleObjects("Combobox1").Objec t.Value or if you are in the code module for sheet1 (the sheet where the combobox is located) combobox1.Value -- Regards, Tom Ogilvy "Joe" wrote in message ... I have the combox in my spreadsheet and have the VBA code running when there is a change to the value, but I don't know how to refer to the combobox to get the currently selected value |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub ComboBox1_Click()
val1 = _ Worksheets("Sheet1").OLEObjects( _ "Combobox1").Object.Value val2 = ComboBox1.Value MsgBox val1 & " - " & val2 End Sub worked fine for me. Not sure what you are talking about. From your description, you may have your code in wrong place, but it is too ambiguous to tell. If you right click on the sheet tab with the combobox and select view code, that is where the code should be. -- Regards, Tom Ogilvy "Joe" wrote in message ... My code is in the Modules section tied to the spreadsheet where I have the function ComboBox1_Change() Neither of the syntaxes you listed work in this context, nor does ActiveSheet.OLEObjects("ComboBox1").Object.Value Any more ideas? "Tom Ogilvy" wrote: worksheets("Sheet1").OleObjects("Combobox1").Objec t.Value or if you are in the code module for sheet1 (the sheet where the combobox is located) combobox1.Value -- Regards, Tom Ogilvy "Joe" wrote in message ... I have the combox in my spreadsheet and have the VBA code running when there is a change to the value, but I don't know how to refer to the combobox to get the currently selected value |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ComboBox AddItem code to reference cells in a Range | Excel Discussion (Misc queries) | |||
How To Reference What Is In A ComboBox In A Cell Formulas??? | Excel Worksheet Functions | |||
How do I copy a combobox to many cells with relative reference? | Excel Discussion (Misc queries) | |||
how to give the source value for a combobox on excel spreadsheet | Excel Discussion (Misc queries) | |||
unprotecting a combobox in your spreadsheet | Excel Programming |