0

I am trying to get the SUM of the LAST 15 rows every time i add more data

Sub SumRange()

'Range("A1", .End(xlDown), Range("ActiveCell").End(xlUp)).Select
Dim upperrang As Long
Dim lowerring As Variant
Dim midpnt As Long
Dim blue As Variant

upperrang = Range("C1").End(xlDown).Select
lowerring = ActiveCell.Address


midpnt = Range("C1").End(xlDown).Offset(-15, 0).Select
blue = ActiveCell.Address
Range("D24").Value = blue

Range("D26").Formula = "=SUM(blue:lowerring)"

End Sub

The output on cell D26 is #NAME?

OnTheHunt
  • 11
  • 6

0 Answers0