+ Reply to Thread
Results 1 to 2 of 2

ListBox: How to determine length of list in different columns

  1. #1
    Forum Contributor
    Join Date
    11-11-2005
    Posts
    267

    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 only produces the Maximum row length of 100.

    Thanks.

  2. #2
    Tom Ogilvy
    Guest

    Re: 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" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1