View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default How do I set up a counter cell?

Hi,

Right click the sheet tab, view code and paste this in. Change the cell
address to whatever you want:-

Private Sub Worksheet_Change(ByVal Target As Range)
Range("A1").Value = ActiveSheet.UsedRange.Rows.Count
End Sub

Mike

"Valpocandi" wrote:

I need to set up a cell that counts the number of rows I am using, and sets
that number in a cell. Is there a way to make sure to check to see if the row
has a value in the first cell. I know i need to set up some type of if
statement for this, but I'm not sure how to go about it. Can anyone help me?