listbox

  • Thread starter Thread starter eggpap
  • Start date Start date
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.
 
Sorry Joes,

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

Thanks,
Emiliano
 
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"
 
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
 
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.
 

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

Back
Top