How to add previous sums in a column to current sums in a column?

How to add previous sums in a column to current sums in a column?

Post by VEQ » Sun, 01 Oct 2006 05:03:02


I'm trying to build a workbook from project plan that keeps a running total
of actual hours. The only problem I'm having is with this summation
question. Numerous employees are entering their weekly hours for the current
week. How do I build a function that adds current weekly hours to the
previous weekly hours in my Actual hours column?

TD
 
 
 

How to add previous sums in a column to current sums in a column?

Post by SkxhdGhhb » Sun, 01 Oct 2006 22:55:01

What you probably need is a little macro that copys the current cumulative
total (previous hours + weekly hours reported) back up into the previous
hours cell and zeros out the weekly hours reported to use at the end of a
week.

Assume that the Previous Hours is kept in B5, that weekly hours for
employees are in C10 through C20, and the the cumulative total of all is in
D21, you could have code like this

Sub StartNewWeek()
Range("B5") = Range("D21")
Range("C10:C20")=0
Exit Sub