Counting the number of nonempty cells

S

Steve

I want to count the number of nonempty cells in column A. However, I do not
want to start with cell A1. I want to begin counting in cell A4. Then I
would llike to assign this value to a variable. Any help would be greatly
appreciated.

Thanks
sc
 
N

Norman Jones

Hi SC,

Try:

Sub Tester()
Dim rng As Range
Dim iCtr As Long

Set rng = Range("A4:A" & Rows.Count)
i = Application.CountA(rng)
'Return count of populated cells
MsgBox iCtr

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top