ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Valid ControlSource values (https://www.excelbanter.com/excel-programming/273490-valid-controlsource-values.html)

Jason Gatsby

Valid ControlSource values
 
Hi - I would try the RowSource property using the syntax
you had suggested previously (viz., sheet1!A1:C5 - This
would give you 3 columns of data available to the combo
control. Then just set ColumnCount, ColoumnHeads,
ColoumnWidth, etc). I would do this manually right on the
property sheet for the control in design mode.

For simple values, I would use a For loop or:
cbo.AddItem "1"
cbo.AddItem "2"
cbo.AddItem "3"
cbo.AddItem "4"

hth -jg


-----Original Message-----
I have a user form in Excel that contains a combo box. I

want to
populate this combo box with four values.

First, can I just key in the values in the ControlSource

property that
I want? For example.. 1;2;3;4? Or do I need to

reference some cells
in the Excel worksheet?

Second, if I have to reference some cells, what is the

proper syntax?
If I key in something like A1:A4, I get an error:

Could not set the ControlSource property. Invalid

property value.

Can someone point me in the right direction?

Thanks.


Dennis Hancy
Eaton Corporation
Cleveland, OH
.



All times are GMT +1. The time now is 04:16 PM.

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