PDA

View Full Version : Cumulative addition - Vb



d2410
12-30-2011, 02:22 AM
Hi,
I am new to VB. Can anyone suggest me a formula or vb script for the following. I have three columns as below


Employee hrs worked in year hrs worked in this month
12345 1000
34556 800

Suppose for this month if i enter 100 hrs for employee 12345,120 hrs for 34556 and so on, the corresponding total no of hrs worked in a year should get automatically upated to 1100,920 for the employee resp.
This should happen for the entire excel for all the employee.

How can this be done?

Aussiebear
12-30-2011, 05:15 AM
Set the range where you post the additional hours to a worksheet_change function so that it adds the additional hours to both the monthly total & Yearly totals

bjoshi
12-30-2011, 06:08 AM
Hi,

I think a formula would be simpler here,
(ColumnA) (ColumnB) (ColumnC) (ColumnD)
(Row1)EmployeeID-----Hrs in Year-----Hrs in Month-----Total Hours
(Row2)ABC -----1000-----------100----------=B2+C2

Dont know if this is what you wanted.

Regards,
bjoshi