Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Hi
I want to be able to use one cell to keep adding new numbers to that will accumulate the total in another cell. Ex: I use A1 as the cell to input a new number that will carry a total in A2 any help would be appreciated |
#2
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Try this in the sheet module.
Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) On Error Resume Next If Target < Range("A1") Then Range("A1").Select Exit Sub End If Application.EnableEvents = False Range("A2").Value = Range("A1").Value + Range("A2").Value Target.Select Application.EnableEvents = True End Sub HTH Regards, Howard "Mex" wrote in message ... Hi I want to be able to use one cell to keep adding new numbers to that will accumulate the total in another cell. Ex: I use A1 as the cell to input a new number that will carry a total in A2 any help would be appreciated |
#3
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Hi Howard
I'm sure what you have provide will be helpful unfortunately I really am a beginner and Im not sure where I should actually be entering this. I thank you for your patience and possibly a little more information. Thanks "L. Howard Kittle" wrote: Try this in the sheet module. Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) On Error Resume Next If Target < Range("A1") Then Range("A1").Select Exit Sub End If Application.EnableEvents = False Range("A2").Value = Range("A1").Value + Range("A2").Value Target.Select Application.EnableEvents = True End Sub HTH Regards, Howard "Mex" wrote in message ... Hi I want to be able to use one cell to keep adding new numbers to that will accumulate the total in another cell. Ex: I use A1 as the cell to input a new number that will carry a total in A2 any help would be appreciated |
#4
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]() -- Don Guillett Microsoft MVP Excel SalesAid Software "Mex" wrote in message ... Hi I want to be able to use one cell to keep adding new numbers to that will accumulate the total in another cell. Ex: I use A1 as the cell to input a new number that will carry a total in A2 any help would be appreciated |
#5
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Right click sheet tabview codecopy/paste this.
Now when you put a number in cell a1 cell a2 will increase by that number. Private Sub Worksheet_Change(ByVal target As Excel.Range) If target.Address < "$A$1" Then Exit Sub Application.EnableEvents = False [a2] = target.Value + [a2] Application.EnableEvents = True End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Mex" wrote in message ... Hi I want to be able to use one cell to keep adding new numbers to that will accumulate the total in another cell. Ex: I use A1 as the cell to input a new number that will carry a total in A2 any help would be appreciated |
#6
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
AWESOME, thanks Don that did the trick. Now Im wondering how to do it again
on 2 different columns for example K2 & P2 on the same sheet. Is there a way to just add to this formula or does it have to be added separately? I tried adding it below the original one you provided but it keeps coming up with the error message: €œambiguous mane detected worksheet_change€ Thanks you have just saved me an incredible amount of time. ïŠ "Don Guillett" wrote: Right click sheet tabview codecopy/paste this. Now when you put a number in cell a1 cell a2 will increase by that number. Private Sub Worksheet_Change(ByVal target As Excel.Range) If target.Address < "$A$1" Then Exit Sub Application.EnableEvents = False [a2] = target.Value + [a2] Application.EnableEvents = True End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Mex" wrote in message ... Hi I want to be able to use one cell to keep adding new numbers to that will accumulate the total in another cell. Ex: I use A1 as the cell to input a new number that will carry a total in A2 any help would be appreciated |
#8
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Even better.
Private Sub Worksheet_Change(ByVal target As Excel.Range) If Not Intersect(target, Range("a1,k1,p1")) Is Nothing Then Application.EnableEvents = False target.Offset(1) = target.Offset(1) + target Application.EnableEvents = True End If End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Don Guillett" wrote in message ... Add it INSIDE the change event. There can only be ONE per tab. Private Sub Worksheet_Change(ByVal target As Excel.Range) If target.Address = "$A$1" Then Application.EnableEvents = False [a2] = target.Value + [a2] Application.EnableEvents = True end if If target.Address = "$P$1" Then Application.EnableEvents = False [p2] = target.Value + [p2] Application.EnableEvents = True end if 'etc End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Mex" wrote in message ... AWESOME, thanks Don that did the trick. Now Im wondering how to do it again on 2 different columns for example K2 & P2 on the same sheet. Is there a way to just add to this formula or does it have to be added separately? I tried adding it below the original one you provided but it keeps coming up with the error message: €œambiguous mane detected worksheet_change€ Thanks you have just saved me an incredible amount of time. ïŠ "Don Guillett" wrote: Right click sheet tabview codecopy/paste this. Now when you put a number in cell a1 cell a2 will increase by that number. Private Sub Worksheet_Change(ByVal target As Excel.Range) If target.Address < "$A$1" Then Exit Sub Application.EnableEvents = False [a2] = target.Value + [a2] Application.EnableEvents = True End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Mex" wrote in message ... Hi I want to be able to use one cell to keep adding new numbers to that will accumulate the total in another cell. Ex: I use A1 as the cell to input a new number that will carry a total in A2 any help would be appreciated |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding entry in one cell to a running total in another cell | Excel Worksheet Functions | |||
How do I automaticly carry a month end total over | Excel Worksheet Functions | |||
carry down total | Excel Discussion (Misc queries) | |||
Calculate intermediate total on page change and carry it over. | Excel Discussion (Misc queries) | |||
Adding numbers in one cell and showing total in seperate cell | Excel Discussion (Misc queries) |