+ Reply to Thread
Results 1 to 5 of 5

Counting blank cells in one column

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-06-2004
    Location
    Carbondale CO
    Posts
    245

    Counting blank cells in one column

    Hi,
    I have two entire rows which I have made Named Ranges.
    1. "CopyDestinationRow2" (actually Row 9 and never changes)
    2. "BelowEntryBottomRow2" (varies from Row 10 to ???) Rows are added and subtracted all the time)

    What I need to do is count the number of blank cells in column B only from "CopyDestinationRow2" to "BelowEntryBottomRow2".

    I have been doing this with a third named range "RFPEntryArea" which is column B from "CopyDestinationRow2" to "BelowEntryBottomRow2" and the following code.
    Cnt2 = Sheets("Request for Proposal Form").Range("RFPEntryArea") _
    .SpecialCells(xlCellTypeBlanks).Count
    The problem is even on a protected sheet if someone uses Cut and paste on column B it changes "RFPEntryArea" and the remaining code goes erratic.
    Casey

  2. #2
    Tom Ogilvy
    Guest

    RE: Counting blank cells in one column

    Dim rng1 as Range, rng2 as Range, rng3 as Range
    set rng1 = Range("CopyDestinationRow2")
    Set rng2 = Range("BelowEntryBottomRow2")
    set rng1 = Intersect(rng1,rng1.parent.columns(2))
    set rng2 = Intersect(rng2,rng2.parent.columns(2))
    set rng3 = rng1.parent.Range(rng1,rng2)
    cnt2 = Application.countblank(rng3)

    ' or
    ' cnt2 = rng3.specialcells(xlblanks).count

    --
    Regards,
    Tom Ogilvy


    "Casey" wrote:

    >
    > Hi,
    > I have two entire rows which I have made Named Ranges.
    > 1. "CopyDestinationRow2" (actually Row 9 and never changes)
    > 2. "BelowEntryBottomRow2" (varies from Row 10 to ???) Rows are added
    > and subtracted all the time)
    >
    > What I need to do is count the number of blank cells in column B only
    > from "CopyDestinationRow2" to "BelowEntryBottomRow2".
    >
    > I have been doing this with a third named range "RFPEntryArea" which is
    > column B from "CopyDestinationRow2" to "BelowEntryBottomRow2" and the
    > following code.
    > Cnt2 = Sheets("Request for Proposal Form").Range("RFPEntryArea") _
    > .SpecialCells(xlCellTypeBlanks).Count
    > The problem is even on a protected sheet if someone uses Cut and paste
    > on column B it changes "RFPEntryArea" and the remaining code goes
    > erratic.
    >
    >
    > --
    > Casey
    >
    >
    > ------------------------------------------------------------------------
    > Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545
    > View this thread: http://www.excelforum.com/showthread...hreadid=570348
    >
    >


  3. #3
    Forum Contributor
    Join Date
    01-06-2004
    Location
    Carbondale CO
    Posts
    245
    Tom,
    It works great. Thank you for the help. I see the use of the intersect function. I'm pretty good with excel worksheet functions, mostly because of the Insert Function dialog box and the help available there. Is there a similar function in the VBE or a list of available VBA functions?

    Casey

  4. #4
    Tom Ogilvy
    Guest

    Re: Counting blank cells in one column

    The object browser in the VBE or the Help in the VBE is what most use.

    --
    Regards,
    Tom Ogilvy


    "Casey" wrote:

    >
    > Tom,
    > It works great. Thank you for the help. I see the use of the intersect
    > function. I'm pretty good with excel worksheet functions, mostly
    > because of the Insert Function dialog box and the help available there.
    > Is there a similar function in the VBE or a list of available VBA
    > functions?
    >
    > Casey
    >
    >
    > --
    > Casey
    >
    >
    > ------------------------------------------------------------------------
    > Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545
    > View this thread: http://www.excelforum.com/showthread...hreadid=570348
    >
    >


  5. #5
    Forum Contributor
    Join Date
    01-06-2004
    Location
    Carbondale CO
    Posts
    245
    Thanks Tom

+ 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