PC Review


Reply
Thread Tools Rate Thread

Counting Rows in 2007

 
 
Ken Hudson
Guest
Posts: n/a
 
      28th Apr 2008
In many of my old macros I used the following code to get a row count in a
worksheet:

CountRows = Range("A65536").End(xlUp).Row

With the changes in 2007 I assume that I should use the following, more
generic code now?

CountRows = Cells(Rows.Count, "A").End(xlUp).Row

--
Ken Hudson
 
Reply With Quote
 
 
 
 
Otto Moehrbach
Guest
Posts: n/a
 
      28th Apr 2008
That or:
CountRows = Range("A" & Rows.Count).End(xlUp).Row
HTH Otto
"Ken Hudson" <(E-Mail Removed)> wrote in message
news:57F7B096-8F2A-41CC-B8E8-(E-Mail Removed)...
> In many of my old macros I used the following code to get a row count in a
> worksheet:
>
> CountRows = Range("A65536").End(xlUp).Row
>
> With the changes in 2007 I assume that I should use the following, more
> generic code now?
>
> CountRows = Cells(Rows.Count, "A").End(xlUp).Row
>
> --
> Ken Hudson



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting characters in multiple rows when rows meet specific criteria news.virginmedia.com Microsoft Excel Worksheet Functions 3 28th Jun 2008 09:03 PM
Counting rows, then counting values. Michael via OfficeKB.com Microsoft Excel Misc 7 4th Aug 2005 10:57 PM
Counting Rows Then Counting Values in Columns Michael via OfficeKB.com Microsoft Excel Programming 1 1st Jun 2005 04:10 PM
counting rows counting empty rows cparsons Microsoft Excel Misc 1 10th Nov 2004 07:12 PM
Counting rows Steve Microsoft Excel Programming 2 6th Apr 2004 05:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:15 PM.