+ Reply to Thread
Results 1 to 10 of 10

Count rows where cells are selected

  1. #1
    Forum Contributor
    Join Date
    03-22-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016-2019
    Posts
    144

    Count rows where cells are selected

    Dear forum readers,

    I am looking for a formula or vba code that counts the number of lines from which the cells are selected in those two columns.

    The first must be 0, the second is 15 and the third should be 23.

    Who can help me with this?

    With Regards,
    FvdF
    Attached Images Attached Images

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Count rows where cells are selected

    YOu have been told before I think to provide workbooks, not pictures of them.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    03-22-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016-2019
    Posts
    144

    Re: Count rows where cells are selected

    With this I only tried to make it clear. Is this a problem then?

    FvdF

  4. #4
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,428

    Re: Count rows where cells are selected

    If you look to the bottom of your Excel-sheet, you can see the number of selected cells. Its the count. In this example: 5.
    Attached Images Attached Images
    Last edited by HansDouwe; 10-03-2023 at 11:30 AM.

  5. #5
    Forum Contributor
    Join Date
    03-22-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016-2019
    Posts
    144

    Re: Count rows where cells are selected

    I do not want the cells to be counted but the number of lines a selected cell contains. See the examples.

  6. #6
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,428

    Re: Count rows where cells are selected

    Oh, the number of selected lines. No that is not shown by Excel and it is not possible with a formula. May be with VBA?

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Count rows where cells are selected

    vba
    Please Login or Register  to view this content.

  8. #8
    Valued Forum Contributor
    Join Date
    11-27-2011
    Location
    usa
    MS-Off Ver
    Excel 2007, Excel 365
    Posts
    495

    Re: Count rows where cells are selected

    How about:

    Please Login or Register  to view this content.
    Last edited by johnnyL; 10-03-2023 at 06:01 PM.

  9. #9
    Forum Contributor
    Join Date
    03-22-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016-2019
    Posts
    144

    Re: Count rows where cells are selected

    Hello jindon & johnnyL

    Both options works great!

    Thanks for your help.

    Muchas Gracias

  10. #10
    Valued Forum Contributor
    Join Date
    11-27-2011
    Location
    usa
    MS-Off Ver
    Excel 2007, Excel 365
    Posts
    495

    Re: Count rows where cells are selected

    Glad we could help.

+ 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. [SOLVED] Code to interchange 2 selected cells from selected rows
    By RAJESH SHAH in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-02-2021, 04:52 PM
  2. [SOLVED] Count Rows in a selected range
    By plans in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-20-2014, 10:20 PM
  3. Count number of rows selected when using advanced filters
    By DanaHoff in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 04-14-2014, 02:13 PM
  4. Get Rows and Count from user selected Area (by cursor)
    By ExcelNorbert in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-19-2011, 04:26 PM
  5. Replies: 2
    Last Post: 08-28-2011, 02:39 AM
  6. Count number of selected rows
    By sys_daw in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-06-2010, 11:54 AM
  7. Count selected rows in sheet (and use as input parameter)
    By nalfin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-04-2009, 11:46 AM

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