#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default listbox

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
userform listbox cannot get listbox.value to transfer back to main sub [email protected] Excel Programming 1 May 17th 06 09:44 PM
avoiding duplicates in listbox (added from another listbox) KR Excel Programming 4 March 14th 06 08:17 PM
VBA: Creating listbox similar to the one in Pivot table (Listbox+Checkbox) modjoe23 Excel Programming 3 August 18th 05 02:35 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM
Is refreshing listbox rowsource in listbox click event possible? Jeremy Gollehon[_2_] Excel Programming 4 September 25th 03 06:45 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"