Can Listfillrange be used with a listbox on a form?

S

Simon Skelton

I have a worksheet which contains a list called "Employees".

I want to use that list to populate a listbox called "lbEmployees" which is
located on a form - instead of using multiple additem entries.

I thought it would be possible to use listfillrange to achieve this goal but
cannot generate the necessary syntax to do so.

Can listfillrange be used with a listbox on a form or is it limited to being
used with a listbox embedded in a worksheet? If it can be used with a form,
what is the best syntax to use?
 
O

OssieMac

Hi Simon,

I think you are referring to a different type of listbox created from the
Forms Toolbar. The type used on a Userform are the type created from the
Control Tools Toolbar.

Try the following

UserForm1.lbEmployees.RowSource = "Employees"
 
O

OssieMac

Hi again Simon,

My previous comment "I think you are referring to a different type of
listbox created from the Forms Toolbar."

My comment above is not correct. The real answer is that some of the
properties of the textbox on a userform differ to the properties when the
textbox is on a worksheet. One of these differences is ListFillRange which
becomes RowSource when on a userform.

The code I gave you for Rowsource on a userform is correct.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top