View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Count rows and insert number to count them.

try

Sub countnonblanks()
lr = Cells(Rows.Count, "a").End(xlUp).Row
br = Range(Cells(1, 1), Cells(lr, 1)).SpecialCells(xlCellTypeBlanks).Count
MsgBox lr - br
End Sub

--
Don Guillett
SalesAid Software

"Mex" wrote in message
...
How do I get excel to automatically count the number of rows with data in
them and insert the row number in a colum. I don't want to count any blank
rows.