Insert Grand total at the end

  • Thread starter Thread starter Payal
  • Start date Start date
P

Payal

Hi, I am inserting grand total at the end of the result, which is
return by a query. I need to calculate from row 49. Its calculating
fine except for at L49 cell which is the first cell...its showing
total twice i.e. if the last row is 70...the total is shown at L71 and
L72...any idea what is wrong in the code??

Lastrowa = Range("b65536").End(xlUp).Row

Range("l49").End(xlDown).Offset(1, 0).Value = _
"=SUM(l49:l" & Range("l49").End(xlDown).Row & ")"

Set desti = Range("l" & Lastrowa + 1 & ":bo" & Lastrowa + 1)
Range("l" & Lastrowa + 1).Copy desti

Thanks
Payal
 
Hi

I've just built your code into a clean book - and your code works fine - placing the total once at the bottom of column L and then copying it to the right to column B

So - either you are using Excel 97, you are hitting the macro button twice, your code is inside a loop or the total is coming in from the import routine..
 

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