Count rows with data

C

catlair

Hi,

What do I need to change for this macro to count only lines with data?

With ActiveSheet
iDataCountRows = .Range("A" & .Rows.Count).End(xlUp).Row
End With

Range("A53").Select
ActiveCell.FormulaR1C1 = iDataCountRows

And what do I do to stop it at the first empty row?

catlair
 
J

JE McGimpsey

catlair said:
Hi,

What do I need to change for this macro to count only lines with data?

With ActiveSheet
iDataCountRows = .Range("A" & .Rows.Count).End(xlUp).Row
End With

Range("A53").Select
ActiveCell.FormulaR1C1 = iDataCountRows

To count only cells in column A with data:

iDataCountRows = Application.CountA(Range("A:A"))
And what do I do to stop it at the first empty row?

Not sure what "it" you're trying to stop.
 
C

catlair

Hi,

Works like a charm! Thanks!

The 'it" I meant was the macro. I did not want to count the empty rows.


regards,
catlair
 
C

catlair

Hi,

Works like a charm! Thanks!

The 'it" I meant was the macro. I did not want to count the empty rows.

Now, how do I stop the macro at the first blank row?

regards,
catlair
 

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