View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_1929_] Rick Rothstein \(MVP - VB\)[_1929_] is offline
external usenet poster
 
Posts: 1
Default refer to a named range in this.workbook

The RowSource property is a String, the RefersToRange is a Range... you
can't assign a range to a String. I'm guessing you may want to do this...

cbFUNCT.RowSource = ThisWorkbook.Names("FUNCT").RefersToRange.Address

where you pickup the actual address from the range. Remember, the
RefersToRange is the actual Range that the Name references.

Rick


"michael.beckinsale" wrote in message
...
Hi Rick,

Thanks for the quick response.

Unfortunately that doesn't seem to solve the problem. Let me explain a
little more.

I am building a workbook which contains a form and a 'list' sheet for
info to populate the form's combo boxs. The form is to be used to
populate any other ad-hoc workbook the user may want. Simply put an
'add-in' type workbook is used to collate the information but the data
is entered into another workbook.

This is example of code l have tried to populate the combo boxes using
the named range

UserForm_Initialize

cbFUNCT.RowSource = ThisWorkbook.Names("FUNCT").RefersToRange

and

cbFUNCT.RowSource = ThisWorkbook.Names("FUNCT")

Any ideas?

Regards

Michael