Dim lastRow As Integer
Dim ws1 As Worksheet
Set ws1 = Sheets("PayoutsTest")
lastRow = ws1.Cells(Rows.count, 1).End(xlUp).Row
'Sum Columns
With ws1.Range("B2")
.FormulaR1C1 = "=SUM(R[1]C:R&lastRow&C)"
End With
Above is the relevant part of my code. The lastRow could be changing so I...