View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Paul Martin Paul Martin is offline
external usenet poster
 
Posts: 114
Default Dynamically assign ComboBox.List from named range areas

Hi guys

I would like to assign a list of values for a ComboBox. I have a named
range of various columns and based on the selection in another
ComboBox, I would like to select the relevant Area of the named range.


The code looks like this:
iBrand = cboBrands.ListIndex + 1
cboProducts.List = Range("AllBrands").Areas(iBrand).Cells.Value

The error message I receive is:
Run-time error '381': Could not set the List property. Invalid
property array index.

This seems very strange as I feel I have thoroughly debugged. I have
ascertained the validity of Range("AllBrands"), iBrand, etc.

Any suggestions appreciated.

Paul Martin
Melbourne, Australia