Go to cell below last entry in column and total

D

Donna

I am doing a macro and I would like for it to automatically go to the cell
below last entry in a column and total. (row count will be different each
time I run the macro) One of the columns has entries in every cell,, and my
other column may have blanks cells in the column. Thanks for your help.
Donna
 
J

Jacob Skaria

Try the below which will insert a total to Col B after last row with data in
the active sheet

Sub Macro()
Dim lngRow As Long
lngRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row + 1
Range("B" & lngRow) = "=SUM(B1:B" & lngRow - 1 & ")"
End Sub

If this post helps click Yes
 

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