PDA

View Full Version : cumulative sum between two dates



av8tordude
12-27-2019, 02:25 AM
This code displays the cumulative sum from the first row to the last row in column P. I would like to find all entries from a date range, place the dates in column R, the values associated with the dates in column S, and the cumulative total in column T



Sub mac()Dim lRow As Long


lRow = Range("P" & Rows.Count).End(xlUp).Row


For i = 2 To lRow
If Range("P" & i) <> "" Then
Range("R" & i) = WorksheetFunction.Subtotal(9, Range("P2:P" & i))
End If
Next
End Sub

p45cal
12-27-2019, 05:01 AM
See attached.