+ Reply to Thread
Results 1 to 10 of 10

Count specific number of rows

  1. #1
    Forum Contributor CobraLAD's Avatar
    Join Date
    07-23-2007
    Location
    Boksburg, South Africa
    MS-Off Ver
    Office 2019
    Posts
    346

    Count specific number of rows

    I have a list with level 5 & level 7 info
    I load level 5 on a listbox on a userform. I have a button that changes the listbox to single select. Then I want a selection to on show the level 7 options for that option. I know the code has to somehow count the rows to the next number 5, but to put it together is a bit tricky for me.

    Can anyone help. I have attached my file.
    Attached Files Attached Files
    Last edited by CobraLAD; 04-26-2015 at 02:09 PM.

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Count specific number of rows

    Perhaps have a look on Pivot Table
    Can you show what you want as result
    - Battle without fear gives no glory - Just try

  3. #3
    Forum Contributor CobraLAD's Avatar
    Join Date
    07-23-2007
    Location
    Boksburg, South Africa
    MS-Off Ver
    Office 2019
    Posts
    346

    Re: Count specific number of rows

    If main listbox is set to single select, I want to click on OPTION 4 and it must show me all Option 4 - Sub Options which in this case is 7 in the second listbox. If I click on OPTION 7 it then must show all Option 7 - Sub Options which is 16

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Count specific number of rows

    Try this in the userform Module:-
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor CobraLAD's Avatar
    Join Date
    07-23-2007
    Location
    Boksburg, South Africa
    MS-Off Ver
    Office 2019
    Posts
    346

    Re: Count specific number of rows

    Thanks MickG it works 100% for this because all sub option has a "-", but my sub options is not always going to have "-".

  6. #6
    Forum Contributor CobraLAD's Avatar
    Join Date
    07-23-2007
    Location
    Boksburg, South Africa
    MS-Off Ver
    Office 2019
    Posts
    346

    Re: Count specific number of rows

    maybe it can use the "7" in column A

  7. #7
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Count specific number of rows

    Try this:-
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor CobraLAD's Avatar
    Join Date
    07-23-2007
    Location
    Boksburg, South Africa
    MS-Off Ver
    Office 2019
    Posts
    346

    Re: Count specific number of rows

    Thank you Mick, this works

  9. #9
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Count specific number of rows

    You're welcome

  10. #10
    Forum Contributor CobraLAD's Avatar
    Join Date
    07-23-2007
    Location
    Boksburg, South Africa
    MS-Off Ver
    Office 2019
    Posts
    346

    Re: Count specific number of rows

    For info another way I figured out
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 12-17-2013, 06:30 AM
  2. Search for specific data and count number of rows till empty Cell
    By kjanani30 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-04-2013, 06:05 AM
  3. count the number of times a number appears in a specific range
    By myjebay1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-18-2013, 11:01 AM
  4. Replies: 3
    Last Post: 02-16-2013, 06:10 PM
  5. Function to Count Number of Consecutive Rows with a Specific Criteria?
    By Templee1 in forum Excel Formulas & Functions
    Replies: 26
    Last Post: 09-06-2005, 03:05 PM

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