#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default FORMULA

I am not sure if Excel is capable of doing this, but hopefully someone out
there knows. I am trying to create a formula to do the following: In one
cell I will have a running total and in the other cell I want to enter a
number that will carry over to the cell with the running total in turn making
that cell blank until another number is entered.

Example: Cell One, enter the number three, Cell Two, current number 150
will change to 153 and Cell One will go back to a blank cell util used again.

????? This would be a great time saver if this is possible.



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default FORMULA

See

http://mcgimpsey.com/excel/accumulator.html


Modify it by inserting the line

.ClearContents

after

Range("B1").Value = Range("B1").Value + .Value


Note that this is, often, very inefficient, since there's no history -
if you make a mistake, it's difficult to recover.


In article ,
mdriscoll wrote:

I am not sure if Excel is capable of doing this, but hopefully someone out
there knows. I am trying to create a formula to do the following: In one
cell I will have a running total and in the other cell I want to enter a
number that will carry over to the cell with the running total in turn making
that cell blank until another number is entered.

Example: Cell One, enter the number three, Cell Two, current number 150
will change to 153 and Cell One will go back to a blank cell util used again.

????? This would be a great time saver if this is possible.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default FORMULA

Hi,

These is no formula to do this, you will need to use VBA. Basically you
want on Worksheet_Change event.

Hi,

Here is an example of event code using the Intersect function:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Isect As Range
Set Isect = Application.Intersect(Target, [A1])
If Not Isect Is Nothing Then
[B1] = [B1] + [A1]
[A1].Clear
End If
End Sub

Here a number is being entered into A1 and then it is added to the entry in
B1 and then A1 is cleared.

1. To add this code to your file, press Alt+F11,
2. In the VBAProject window, top left side, find your sheet name under your
file name and double click it.
3. Paste in or type the code above.

If this helps, please click the Yes button

Cheers,
Shane Devenshire

"mdriscoll" wrote:

I am not sure if Excel is capable of doing this, but hopefully someone out
there knows. I am trying to create a formula to do the following: In one
cell I will have a running total and in the other cell I want to enter a
number that will carry over to the cell with the running total in turn making
that cell blank until another number is entered.

Example: Cell One, enter the number three, Cell Two, current number 150
will change to 153 and Cell One will go back to a blank cell util used again.

????? This would be a great time saver if this is possible.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"