What is the correct syntax to make this line of code work:
CtrLastColumn is defined as![]()
.Cells(2, CtrLastColumn).FormulaR1C1 = Application.WorksheetFunction.Sum(.Range("B2:" & CtrLastColumn & "2"))
As it is it's giving me an Application-defined or Object-defined error. It is in a With Sheets block.![]()
Dim CtrLastColumn As Integer
Bookmarks