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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rowsource 1

Status
Not open for further replies.

Igwiz

Technical User
Jun 3, 2003
88
CA
Am I right in thinking that when you are assigning the rowsource or controlsource of a combobox, you have to use explicit cell references and can't use range names?

This works:
ComboBox1.RowSource = "'[book1.xls]Sheet1'!$A$1:$A$10"

But this doesn't
ComboBox1.RowSource = "'[book1.xls]Sheet1'!RangeToUse"

Can you use range names?

Thanks.

IG
 
try this:
ComboBox1.ListFillRange = Range("rangetouse").Address

Rgds, Geoff
Quantum materiae materietur marmota monax si marmota monax materiam possit materiari?
Want the best answers to your questions ? faq222-2244
 
Hi Geoff,

Doesn't like it. I get a compile error saying "Method or data member not found". I forget to mention that I am doing this for a form and the code is in the userform_initialize routine.

Thanks,
Ig
 
for some reason, in a worksheet, you have to use the ListFillRange. On a userform it is Rowsource so
ComboBox1.rowsource = Range("rangetouse").Address

Rgds, Geoff
Quantum materiae materietur marmota monax si marmota monax materiam possit materiari?
Want the best answers to your questions ? faq222-2244
 
Brilliant! It was the fact I was missing off the .address that stopped it working. Many thanks and a star.

Ig
 
Need to use "Address" as the rowsource / listfillrange take a STRING source rather than a range

Rgds, Geoff
Quantum materiae materietur marmota monax si marmota monax materiam possit materiari?
Want the best answers to your questions ? faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top