Find last empty row

  • Thread starter Thread starter poppy
  • Start date Start date
P

poppy

Hi

I made a mess of my last post, but here goes.

I would like to be able to find the last empty row in a worksheet ski
one row and then sum up the totals of each column in this row.

I hope this is clearer than my last post
Thanx for your help

Kind Regard
 
The following inserts a formula in the last empty row of a column and sums
all values.
You can adpat this for the column, range etc as required

Dim lastrow As Long
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Cells(lastrow + 1, 1).Formula = "=sum(A1:A" & lastrow & ")"


Cheers
Nigel
 
Have you thought about putting the totals at the top of your data rather
than at the bottom. Then the formula can sum right down to 65000 if you
want, and no need for a macro at all.

Chris
 
When I put the totals at the top, I'll also use the =subtotal() function. Then
when I apply data|Filter|autofilter, I get to see the subtotals for the visible
rows.
 

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

Back
Top