ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can Listfillrange be used with a listbox on a form? (https://www.excelbanter.com/excel-programming/423595-can-listfillrange-used-listbox-form.html)

Simon Skelton[_2_]

Can Listfillrange be used with a listbox on a form?
 
I have a worksheet with a list called "Employees"

I want to use that list to populate a listbox called "lbEmployees" on a form
instead of using multiple lines of additem.

I thought this would have been possible using listfillbox but, if it is, I
can't generate the correct syntax. I am beginning to think that listfillbox
can only be used with listboxes embedded in a worksheet - although that does
sound somewhat illogical.

Are there any suggestions as to the correct syntax that I should use to
allow me to use listfillbox in a form?

Cheers.

OssieMac

Can Listfillrange be used with a listbox on a form?
 
Hi Simon,

Try the following.

UserForm1.Show
UserForm1.ListBox1.RowSource = "Sheet1!A1:A20"


--
Regards,

OssieMac


"Simon Skelton" wrote:

I have a worksheet with a list called "Employees"

I want to use that list to populate a listbox called "lbEmployees" on a form
instead of using multiple lines of additem.

I thought this would have been possible using listfillbox but, if it is, I
can't generate the correct syntax. I am beginning to think that listfillbox
can only be used with listboxes embedded in a worksheet - although that does
sound somewhat illogical.

Are there any suggestions as to the correct syntax that I should use to
allow me to use listfillbox in a form?

Cheers.


Rick Rothstein

Can Listfillrange be used with a listbox on a form?
 
You should really stick with your original thread. This what I posted
there...

Try this...

cmbName.RowSource = "Employees"

--
Rick (MVP - Excel)


"Simon Skelton" wrote in message
...
I have a worksheet with a list called "Employees"

I want to use that list to populate a listbox called "lbEmployees" on a
form
instead of using multiple lines of additem.

I thought this would have been possible using listfillbox but, if it is, I
can't generate the correct syntax. I am beginning to think that
listfillbox
can only be used with listboxes embedded in a worksheet - although that
does
sound somewhat illogical.

Are there any suggestions as to the correct syntax that I should use to
allow me to use listfillbox in a form?

Cheers.




All times are GMT +1. The time now is 02:56 AM.

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