Reputation: 546
I need to add up the total for column L, I know the first and last rows:
lRow = Cells(Rows.Count, 2).End(xlUp).Row
fRow = Cells(lRow, "B").Value
So how do I use lRow
and fRow
in my SUM?
Upvotes: 1
Views: 2056
Reputation: 43595
activecell.Formula = "=SUM(L" & lrow & ":L" & frow & ")"
Edit - Added:
Sub Assign
dim dbl_assign as long
lRow = Cells(Rows.Count, 2).End(xlUp).Row
fRow = Cells(lRow, "B").Value
activecell.Formula = "=SUM(L" & lrow & ":L" & frow & ")"
dbl_assign = activecell.value
end sub
Upvotes: 3