Sum
Can you work with this?
Option Explicit
Sub dynamicsumming()
Dim lastrow As Long
Dim ws As Worksheet
Set ws = Worksheets("Movies")
lastrow = Cells(Rows.Count, "I").End(xlUp).Row
Range("G1") = "=sum(I1:I" & lastrow & ")"
End Sub
HTH,
Ryan---
--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.
"Bishop" wrote:
I'm trying to sum all the values in a column and assign it to a variable.
This what I tried:
With Worksheets("Movies")
Paid = .Sum("I:I")
but Sum apparently doesn't take column references. Is there a way around
this?
|