How to load a listbox in a userform?

M

Martin

Hi all,
How do I load a listbox in a userform. I've been trying to look for articles
or leassons but have not found anything. Please help.

By the way, thank's to everybody who answered my last question.

Martin
 
T

Toppers

Create a dynamic range with your data .... say "MyList"

In the Properties of the Listbox, set Rowsource attribute to "Mylist" (no
quotes)

Clicking on the Listbox in VBE should give you the Properties window

HTH
 
M

Martin

Can you please explain more in detail what to do. When I write Mylist in the
rowsource field I get an error message.
Thank you
Martin
 
T

Toppers

To create named (non-dynamic) range:

Highlight your list of data (say A1:A20)

Insert=>Name=>Define ...give it a name ("Mylist").

Rowsource should now work.

For a dynamic range, set the 'Refers to' entry In the Define step) as:

=OFFSET(Sheet1!$A$1,,,COUNTA(Sheet1!$A:$A),1)

Change Sheet1 & column (A) if required: this assumes data starts in row 1 (A1)

HTH
 
Top