ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Set the value of a combobox (https://www.excelbanter.com/excel-programming/328248-set-value-combobox.html)

Bruce

Set the value of a combobox
 
I have a combobox that I want to set the value of as a default, but I get the
error
'Object doesn't support this property or method'.

Any ideas on how to fix?

Bruce

Sub reset()
Set Sheets("Sheet1").Shapes("ComboBox1").Value = 3
End Sub



papou

Set the value of a combobox
 
Hello Bruce
If combo from the Tools Box, try this:
Sheet1.ComboBox1.Value = 3

HTH
Cordially
Pascal

"Bruce" a écrit dans le message de
...
I have a combobox that I want to set the value of as a default, but I get

the
error
'Object doesn't support this property or method'.

Any ideas on how to fix?

Bruce

Sub reset()
Set Sheets("Sheet1").Shapes("ComboBox1").Value = 3
End Sub





Bob Phillips[_7_]

Set the value of a combobox
 
Bruce,

Set is used to create an object variable. The value of a combobox is a
property, so you do not use set.

Which combobox type are you using?

--
HTH

Bob Phillips

"Bruce" wrote in message
...
I have a combobox that I want to set the value of as a default, but I get

the
error
'Object doesn't support this property or method'.

Any ideas on how to fix?

Bruce

Sub reset()
Set Sheets("Sheet1").Shapes("ComboBox1").Value = 3
End Sub






All times are GMT +1. The time now is 11:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com