View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Summary in the last row

Sub slr()
dim mc as long
Dim lr As Long
mc = 4 'col D
lr = Cells(Rows.Count, mc).End(xlUp).Row
Cells(lr + 1, mc) = _
Application.Sum(Range(Cells(1, mc), Cells(lr, mc)))
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Mia" wrote in message
...
Hi,

I'm need to make a vba macro where the macro automaticly shall find
the last row and make a summary of the total column D. I cant get
It right, can someone please help?

So far I only has typed following.

Dim lngLastRow As Long
lngLastRow = ActiveSheet.Cells(Rows.Count, "D").End(xlUp).Row
Range("D" & lngLastRow + 1) = _

--
Best regards
Mia