-
Solved: Accumulate the values
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
-
[VBA]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
[/vba]
-
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
-
If there is a specific cell in column B that always takes the value from column A:[vba]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
[/vba]If you want the cell in column B in the same row as the cell in column A to be added to:[vba]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
[/vba]
-
Works perfectly Nate….
Thanks a lot…..
- Sindhuja
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules