spencerp237
New Member
- Joined
- Feb 24, 2017
- Messages
- 26
Code:
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 want to used a named range. Is there a way to insert that into a R1C1 reference like I tried doing above?
Thanks for any help.