PC Review


Reply
Thread Tools Rate Thread

Counting populated rows in excel

 
 
noname
Guest
Posts: n/a
 
      11th Nov 2003

I have some rows populated in an excel sheet. Is there a way I can writ
a macro to count the number of populated rows

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      12th Nov 2003
Can you pick out a column that's always filled in?

If yes, then maybe you could do this:

Option Explicit
Sub testme()
Dim LastRow As Long
With Worksheets("sheet1")
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With

MsgBox LastRow & " is the last row with data in column A"

End Sub

if there are two rows of headers, just subtract 2.
MsgBox LastRow - 2 & " is the total number of rows"

But there are lots of ways to get the number rows.

noname wrote:
>
> I have some rows populated in an excel sheet. Is there a way I can write
> a macro to count the number of populated rows ?
>
> ------------------------------------------------
> ~~ Message posted from http://www.ExcelTip.com/
> ~~View and post usenet messages directly from http://www.ExcelForum.com/


--

Dave Peterson
(E-Mail Removed)
 
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 populated cells in another worksheet Fox via OfficeKB.com Microsoft Excel Worksheet Functions 0 4th May 2007 03:11 PM
Can Excel tell me how many rows are populated via a functions? =?Utf-8?B?Sm9zaA==?= Microsoft Excel Programming 2 1st Dec 2004 12:04 AM
Counting populated fields in crosstab Adam Carpenter Microsoft Access Queries 5 29th Nov 2003 02:58 PM
How to count the populated rows in excel noname Microsoft Excel Worksheet Functions 2 12th Nov 2003 01:09 AM
Counting Rows in Excel Ray -13 Microsoft Excel Misc 2 9th Jul 2003 07:31 AM


Features
 

Advertising
 

Newsgroups
 


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