ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   listbox (https://www.excelbanter.com/excel-programming/410273-listbox.html)

eggpap

listbox
 
how to fill a listbox with one m x n range values?
thanks,
Emiliano



joel

listbox
 
You must enter Design Mode to add Ranges. When you first Add a listbox you
are in design Mode automatically and you can right click on the Listbox to
add ranges by Right Click on Listbox - Properties - ListFillRange. Enter
something like A1:A10.

to Add a Listbox or change ListFillRange do the following
1) Use toolbar "Control Toolbox". If you don't have one then go to View
Menu - Toolbars and select "Control Toolbox"
2) Pressing the triangle on the Toolbar toggles between Normal Mode and
Design Mode. Enter Design Mode
3) Right Click Listbox and Select Properties. If you can't do this then you
are not in Design Mode. Click the triangle again
4) ListFillRange. Enter something like A1:A10.
5) Press Triangle again to exit Design Mode.

"eggpap" wrote:

how to fill a listbox with one m x n range values?
thanks,
Emiliano




eggpap

listbox
 
Sorry Joes,

I think to have been not clear in my request.
I referred to the listbox control on an user form.

Thanks,
Emiliano



joel

listbox
 
You can do it two ways.

1) Manual - go to the VBA menu and view properties window and in RowSource
box add something like sheet1!A1:A10
2) From code. It is similar to the manual mode.
Listbox1.RowSounce = "sheet1!A1:A10"

"eggpap" wrote:

Sorry Joes,

I think to have been not clear in my request.
I referred to the listbox control on an user form.

Thanks,
Emiliano




eggpap

listbox
 
I followed your tip but I get
a message similar to the following:
Impossible to set the rowsource property. Property value is not valid.

Emiliano



joel

listbox
 
try doing it manually 1st until you get the format correct. Makesure the
Properties window shows the name of the Listbox when you add the RowSource.
don't use double quotes when you put the sheet name and cell range into the
RowSource box.

The try it from code. for testing you can read the setting by using a msgbox

msgbox("Source = " & userform1.listbox1.RowSource)

Make sure the names of the userform and listbox are the same as your code.

"eggpap" wrote:

I followed your tip but I get
a message similar to the following:
Impossible to set the rowsource property. Property value is not valid.

Emiliano





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

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