2016-09-28 113 views

回答

3
activecell.Formula = "=SUM(L" & lrow & ":L" & frow & ")" 

編輯 - 添加:

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 
+0

謝謝 - 我怎麼會用它來分配由下式檢索到的VBA一個變量的值? – davidjwest

+0

@davidjwest - 請參閱編輯。 – Vityata