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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel ListCount Maximum

Status
Not open for further replies.

B827

Technical User
Feb 14, 2002
281
GB
I have inherited a Excel workbook which has a listbox populated by a query on a database table. Recently the number of records returned has exceeded 60. The following code is used to red the selected items.

For i = 0 To LBSubjects.ListCount - 1
If LBSubjects.Selected(i) Then
keystr = keystr & LBSubjects.List(i, 0) & ","
End If
Next

Unfortunately this only goes as far as the 60th record and then exits the loop.

The ListCount appears to be a fixed at a maximum of 60 and is readonly property.

Does anyone have a method of reading through all the records?

Many thanks

Sandy
 



Hi,

This is a VBA question. Please post in Forum707 AND please include...

The code that loads the listbox.

Also, what kind of ListBox control -- Control Toolbox, Forms, Data/Validation?

Is this control on a SHEET or in a UserForm?

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Thanks Chip,
I wasn't sure where to put this. I'll look into it and get the rest of the information. As far as I can tell it uses XML from an ASP page to communicate with the db so it may take me a little while as fixing this is in adition to my normal work.


Many thnaks


Sandy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top