Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I am creating a pipeline that has new data entered each week. I want the
weekly figure to automatically add on to the monthly figure. Eg. A B C 1 Weekly Monthly YTD 2 $100 $500 $600 The monthly will get cleared to $0 at the beginning of each month but I want the YTD to continue increasing. So when I enter a figure into A2, I want it to add on to C2 as well. Help please - thanks |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
You will have to use VBA to do this but be warned: if you make an mistake on
the input to A2 this be reflected in the Monthly and Yearly totals which would then have to be corrected manually. Also there is no audit trail of your transactions. So may want to review whether this is the best approach. "Molly" wrote: I am creating a pipeline that has new data entered each week. I want the weekly figure to automatically add on to the monthly figure. Eg. A B C 1 Weekly Monthly YTD 2 $100 $500 $600 The monthly will get cleared to $0 at the beginning of each month but I want the YTD to continue increasing. So when I enter a figure into A2, I want it to add on to C2 as well. Help please - thanks |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
right click sheet tabview codecopy/paste this
this will increase a2 by whatever you input into a2 Private Sub Worksheet_Change(ByVal target As Excel.Range) If target.Address = "$A$2" Then On Error GoTo fixit Application.EnableEvents = False If target.Value = 0 Then oldvalue = 0 target.Value = 1 * target.Value + oldvalue oldvalue = target.Value fixit: Application.EnableEvents = True End If End Sub -- Don Guillett SalesAid Software "Molly" wrote in message ... I am creating a pipeline that has new data entered each week. I want the weekly figure to automatically add on to the monthly figure. Eg. A B C 1 Weekly Monthly YTD 2 $100 $500 $600 The monthly will get cleared to $0 at the beginning of each month but I want the YTD to continue increasing. So when I enter a figure into A2, I want it to add on to C2 as well. Help please - thanks |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
One way:
Put this in your worksheet code module (right-click the worksheet tab and choose View Code): Private Sub Worksheet_Change(ByVal Target As Excel.Range) With Target If .Address(False, False) = "A2" Then If IsNumeric(.Value) Then On Error Resume Next Application.EnableEvents = False .Offset(0, 1).Value = .Offset(0, 1).Value + .Value .Offset(0, 2).Value = .Offset(0, 2).Value + .Value Application.EnableEvents = True On Error GoTo 0 End If End If End With End Sub In article , Molly wrote: I am creating a pipeline that has new data entered each week. I want the weekly figure to automatically add on to the monthly figure. Eg. A B C 1 Weekly Monthly YTD 2 $100 $500 $600 The monthly will get cleared to $0 at the beginning of each month but I want the YTD to continue increasing. So when I enter a figure into A2, I want it to add on to C2 as well. Help please - thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cell Calculation | Excel Worksheet Functions | |||
making a cell zero out after calculation | Excel Discussion (Misc queries) | |||
How do I exclude a cell from an average calculation when the cell. | Excel Discussion (Misc queries) | |||
How to see calculation and heading in same cell. | Excel Discussion (Misc queries) | |||
Calculation within a Cell | New Users to Excel |