Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA: Set number of items to display in userform listbox

Status
Not open for further replies.

vikingatc

Technical User
Jul 5, 2006
8
US
I've got a listbox that gets its values from a range on an associated worksheet. The range size varies on a search result. The problem is this: if the results returns, say, 5 items the first time it is run, the box will display the 5 items just fine. If the next result is more than 5 items, it will display only the first 5 items in the listbox. The range ont he worksheet resizes correctly each time, but the box display seems "locked" on the first number it gets. I just can't seem to find a property to set to correc this. Any suggestions?

Thanks
 
Have a look at the RowSource property.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks, but I've exhausted all the normal resources. No one seems to be able to track down this problem. There is no property to set for rows displayed, strange, but true. When I reload the form, the box will show all the results, until the above-described situation results again. very strenge. thanks, though.
 
Straight from the VBA help:
ListBox1.RowSource = "a1:e4"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
thanks for your help. The problem persists and I suspect it is likely user error 8). Thanks for your time and for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top