macro to find out the last cell in a range

  • Thread starter Thread starter vikram
  • Start date Start date
V

vikram

i have a column which has a total in the end but the number of rows i
that column varies. I want a macro that gives me the total in a cell
specify in the same worksheet

please help!
thank
 
You don't need vba for this. Just use INDIRECT where 16 is in cell g1 to sum
d1:d16
=SUM(INDIRECT("D1:D"&G1))
 
This formula will return the last value in a column. (as is, down to ro
40)

=INDEX($P:$P,(MAX(($P$1:$P$40<>"")*(ROW($P$1:$P$40)))))

Array entered CTRl + Shift +Enter

B
 

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