PDA

View Full Version : Solved: Accumulate the values



sindhuja
07-22-2009, 05:41 AM
Hello...
I have a doubt.. this might be simple but still…

I have a column A and a column B with Sum of values of Column A.
If enter value in column A the value should add up to the existing value in column B

A B
10 256330


If I change to 20 then B value should be 256330+20
Like this I need to accumulate the values everyday…

any help on this please..

-Sindhuja

nst1107
07-22-2009, 11:44 AM
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Intersect(Target, Cells(1, 1)) Is Nothing Then Exit Sub
Cells(1, 2) = Cells(1, 2) + Cells(1, 1)
End Sub

sindhuja
07-22-2009, 12:24 PM
Thank you so much for the response... its specific for a single cell..
if that is to applicable to the whole column then where should i change...

-Sindhuja

nst1107
07-22-2009, 01:19 PM
If there is a specific cell in column B that always takes the value from column A:Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Intersect(Target, Columns("A")) Is Nothing Then Exit Sub
Cells(1, 2) = Cells(1, 2) + Target
End Sub
If you want the cell in column B in the same row as the cell in column A to be added to:Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Intersect(Target, Columns("A")) Is Nothing Then Exit Sub
Target.Offset(, 1) = Target.Offset(, 1) + Target
End Sub

sindhuja
07-23-2009, 05:38 AM
Works perfectly Nate….
Thanks a lot…..

- Sindhuja