+ Reply to Thread
Results 1 to 5 of 5

VBA code to get the count of visible rows after filter

  1. #1
    Registered User
    Join Date
    06-01-2016
    Location
    Singapore
    MS-Off Ver
    13
    Posts
    55

    VBA code to get the count of visible rows after filter

    Hellp Guys,

    I am trying to find a code that will return the count of visible rows after using autofilter.

    I actually want to place the return value on a cell. Example: if the no of rows visible if 64 on Sheet1 and I want to place the value "64" on Cell B1 on Sheet2.

    Please let me know if its possible

    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: VBA code to get the count of visible rows after filter

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

  3. #3
    Registered User
    Join Date
    06-01-2016
    Location
    Singapore
    MS-Off Ver
    13
    Posts
    55

    Re: VBA code to get the count of visible rows after filter

    Thanks for the prompt reply.
    Sorry, I forgot to tell you the Sheet names. Sheet1 is named as Stock-in and Sheet2 as "Avail"

    So, I modified your code as below.
    Please Login or Register  to view this content.
    I get an error: Subscript out of range. Please correct me

  4. #4
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: VBA code to get the count of visible rows after filter

    Your code is correct. Can you upload a small sample?

  5. #5
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: VBA code to get the count of visible rows after filter

    Have you tried

    Please Login or Register  to view this content.
    was a but unsure what you wanted but rereading I assume you wish to find the number of visible rows so I've change formula function number from 9 (will give you sum of visible rows) to 103 that counts the number of visible rows.

    Alf
    Last edited by Alf; 09-10-2016 at 10:43 AM. Reason: Missunderstood OP's request

+ 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. User defined function- count color and count only visible rows
    By marsjanik1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2016, 03:05 PM
  2. Formula to count number of visible rows, and formula to count visible blanks
    By radoncadonc in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-28-2015, 04:19 PM
  3. Sumifs with visible rows after filter
    By johnny_p in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-14-2015, 12:59 PM
  4. Table Object after filtering - Count visible rows & First visible row
    By limalf in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-13-2013, 07:29 PM
  5. delete all visible rows after a filter
    By penfold1992 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-10-2013, 07:02 AM
  6. Count blank visible cells under filter
    By digita in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-04-2010, 06:18 PM
  7. How do I count visible items in an auto filter?
    By n2lectual in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 03-19-2008, 08:15 PM

Tags for this Thread

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