N
Nigel
I am trying to use code using a fixed starting point and a variable end point
the code I am using is this
Dim lastrow4 As Long
lastrow4 = ActiveSheet.Cells(Rows.Count, "b").End(xlUp).Row * -1
Range("D" & lastrow2) = "=SUM(R[lastrow4]C:R[-1]C)"
Range("E" & lastrow2) = "=SUM(R[lastrow4]C:R[-1]C)"
the idea is that lastrow4 is the lastrow, in code if it was a fixed start
and end point it would read
Dim lastrow2 As Long, lastrow4 As Long
lastrow4 = ActiveSheet.Cells(Rows.Count, "b").End(xlUp).Row * -1
lastrow2 = ActiveSheet.Cells(Rows.Count, "b").End(xlUp).Row + 1
Range("D" & lastrow2) = "=SUM(R[-63]C:R[-1]C)"
the first cell in the calculation is always D7 or E7 etc but the ending cell
is variable, any help is as alway appreciated
the code I am using is this
Dim lastrow4 As Long
lastrow4 = ActiveSheet.Cells(Rows.Count, "b").End(xlUp).Row * -1
Range("D" & lastrow2) = "=SUM(R[lastrow4]C:R[-1]C)"
Range("E" & lastrow2) = "=SUM(R[lastrow4]C:R[-1]C)"
the idea is that lastrow4 is the lastrow, in code if it was a fixed start
and end point it would read
Dim lastrow2 As Long, lastrow4 As Long
lastrow4 = ActiveSheet.Cells(Rows.Count, "b").End(xlUp).Row * -1
lastrow2 = ActiveSheet.Cells(Rows.Count, "b").End(xlUp).Row + 1
Range("D" & lastrow2) = "=SUM(R[-63]C:R[-1]C)"
the first cell in the calculation is always D7 or E7 etc but the ending cell
is variable, any help is as alway appreciated