+ Reply to Thread
Results 1 to 3 of 3

Count empty cell while filter is "ON"

  1. #1
    Registered User
    Join Date
    02-09-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    4

    Count empty cell while filter is "ON"

    Hi,

    I am having a code to find the empty cell in the column "B",while filtering column "A". But code count till the end of the column. i want the count of empty cell till the data available in the column "A"

    Please help.

    Sub Countblanks()
    On Local Error GoTo errors
    Rows("2:2").Select
    Selection.AutoFilter
    ActiveSheet.Range("$A$2:$E$12").AutoFilter Field:=1, Criteria1:="dinesh"
    Sheets(ActiveSheet.Index + 1).Range("A1").Value = _
    WorksheetFunction.CountIf(Range("B:B"), "")
    Exit Sub
    errors:
    MsgBox Err.Description
    Err.Clear
    End Sub

    Thanks,
    Dinesh

  2. #2
    Valued Forum Contributor
    Join Date
    12-05-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010 & 2013
    Posts
    308

    Re: Count empty cell while filter is "ON"

    After the filter, you can do this with a worksheet function:
    =SUBTOTAL(103,A3:A12)-SUBTOTAL(103,B3:B12)

    Cheers, Rob.

  3. #3
    Registered User
    Join Date
    02-09-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Count empty cell while filter is "ON"

    Quote Originally Posted by rscsmith View Post
    After the filter, you can do this with a worksheet function:
    =SUBTOTAL(103,A3:A12)-SUBTOTAL(103,B3:B12)

    Cheers, Rob.
    Hi Rob,


    Thanks for the help... But data may change some time while filtering..

    Regards,
    Dinesh

+ 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