Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 8th, 2006, 11:04 AM
Authorized User
 
Join Date: Sep 2006
Posts: 73
Thanks: 6
Thanked 0 Times in 0 Posts
Default Counting Number of Rows Between Data Range

Hello all:

I am trying to perform a count of rows between a data range.
I have A:2 which has "attending" in the cell. I have A:1455 that
has "officer" in it. A:2566 is the last data cell and A:2567 is empty. I would like to count from Row 3 to Row 1454, the number of rows and then from Row 1456 to Row 2566, the number of rows. No matter what I try, it fails.

Any insight would be appreciated.

Thanks,
Tony

 
Old September 14th, 2006, 06:58 PM
Authorized User
 
Join Date: Sep 2006
Posts: 73
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Any ideas?

 
Old September 15th, 2006, 05:44 AM
Authorized User
 
Join Date: Mar 2006
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

try the following
Code:
dim longAtending as long
dim longofficer as long

'assuming there is an empty cell before "Officer"
longattending = cells(3,1).end(xldown).row - 3 

'-3 because whole list starts at A3, and -2 because one blank row then Officer 
longofficer = cells(longattending + 2,1).end(xldown).row -(longattending-3-2)

air coded so forgive any mistakes.. if there is no blank row before officer, then you need to alter the code a bit

 
Old September 16th, 2006, 02:03 PM
Authorized User
 
Join Date: Sep 2006
Posts: 73
Thanks: 6
Thanked 0 Times in 0 Posts
Default



 
Old September 16th, 2006, 02:05 PM
Authorized User
 
Join Date: Sep 2006
Posts: 73
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Excuse my last blank post. I hit the touchpad with my thumb by accident.
It is a touchy devil.

Thank you for the advice. I will give it a try.

 
Old September 18th, 2006, 06:18 AM
Authorized User
 
Join Date: Sep 2006
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

http://www.dotxls.com/excel-security...rotected-sheet

go through this url u can find solution
do r&d def u can get

Thanks&Regards
Kotaiah.K
91+9867814180

 
Old September 21st, 2006, 07:17 AM
Authorized User
 
Join Date: Sep 2006
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ekkadannakuttakanipistepoinakumundakodakapukuloelu pettukoranakodaka






Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting rows in Excel worksheet Tethys BOOK: Access 2003 VBA Programmer's Reference 1 December 18th, 2007 04:38 AM
Counting number of spaces in a line Suomi Access VBA 3 September 9th, 2005 02:34 PM
Number range using JavaScript busher Classic ASP Basics 1 December 14th, 2004 08:35 PM
Prime Number Counting. Help!! ajm235 C++ Programming 3 August 27th, 2004 12:00 PM
Determine the number of data rows in a sheet ashu_gupta75 Excel VBA 1 July 31st, 2004 03:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.