Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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


------------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545
View this thread: http://www.excelforum.com/showthread...hreadid=570348

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Counting blank cells in one column


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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Counting blank cells in one column


Thanks Tom


--
Casey


------------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545
View this thread: http://www.excelforum.com/showthread...hreadid=570348

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting Blank Cells until end of Column Benjamin Excel Worksheet Functions 3 May 31st 09 07:00 AM
Counting non-blank cells in a column, excluding hidden rows SisterDell Excel Worksheet Functions 3 June 1st 07 03:31 PM
Counting blank cells geoff1234 Excel Discussion (Misc queries) 7 July 10th 06 11:29 AM
counting blank cells bdq17 Excel Discussion (Misc queries) 6 December 7th 05 08:46 PM
Counting blank cells Kevin G[_2_] Excel Programming 1 February 6th 04 07:53 AM


All times are GMT +1. The time now is 10:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"