ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to load a listbox in a userform? (https://www.excelbanter.com/excel-discussion-misc-queries/151632-how-load-listbox-userform.html)

Martin

How to load a listbox in a userform?
 
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

Toppers

How to load a listbox in a userform?
 
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

"Martin" wrote:

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


Martin

How to load a listbox in a userform?
 
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

"Toppers" wrote:

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

"Martin" wrote:

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


Toppers

How to load a listbox in a userform?
 
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

"Martin" wrote:

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

"Toppers" wrote:

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

"Martin" wrote:

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



All times are GMT +1. The time now is 11:11 PM.

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