ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ListBox: How to determine length of list in different columns (https://www.excelbanter.com/excel-programming/352141-listbox-how-determine-length-list-different-columns.html)

Myles[_45_]

ListBox: How to determine length of list in different columns
 

Suppose I have worksheet data covering A1:A50; B1:B85, C1:C100, D1:D5
and this is loaded into a listbox using the RowSource property, how
could I, -without reference to the worksheet-, return the number of
rows (seperately) in Columns 1,2,3 and 4. In this instance, the
solution will be 50 for Column1, 85 for Column2, 100 for Column3 and 5
for Column4.

Note that using ListBox1.ListCount property inappropriately produces
the Maximum row length of 100.

Thanks.


--
Myles
------------------------------------------------------------------------
Myles's Profile: http://www.excelforum.com/member.php...o&userid=28746
View this thread: http://www.excelforum.com/showthread...hreadid=507530


Tom Ogilvy

ListBox: How to determine length of list in different columns
 
First, it would be silly not to use the range if that was the easiest answer
and certainly no reason not to.

Your choices with that limitation are pretty much to loop through each row
in your list and count.

Why do you say the Listcount result of 100 is inappropriate. You have 100
rows in the list, so that is the appropriate answer.
--
Regards,
Tom Ogilvy

"Myles" wrote in
message ...

Suppose I have worksheet data covering A1:A50; B1:B85, C1:C100, D1:D5
and this is loaded into a listbox using the RowSource property, how
could I, -without reference to the worksheet-, return the number of
rows (seperately) in Columns 1,2,3 and 4. In this instance, the
solution will be 50 for Column1, 85 for Column2, 100 for Column3 and 5
for Column4.

Note that using ListBox1.ListCount property inappropriately produces
the Maximum row length of 100.

Thanks.


--
Myles
------------------------------------------------------------------------
Myles's Profile:

http://www.excelforum.com/member.php...o&userid=28746
View this thread: http://www.excelforum.com/showthread...hreadid=507530





All times are GMT +1. The time now is 07:24 PM.

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