+ Reply to Thread
Results 1 to 8 of 8

add/subtract when typing into same cell

  1. #1
    Registered User
    Join Date
    10-22-2007
    Posts
    39

    add/subtract when typing into same cell

    Is there a formula or something which will let a cell remember the value that was previously in that cell and then when you type a new value into the same cell will add or subtract what you typed in from what was originally in there?

    I.E. Cell contains 10, and I type -5 into that cell and it automatically changes the value to 5.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,526
    Quote Originally Posted by zb61
    Is there a formula or something which will let a cell remember the value that was previously in that cell and then when you type a new value into the same cell will add or subtract what you typed in from what was originally in there?

    I.E. Cell contains 10, and I type -5 into that cell and it automatically changes the value to 5.
    Nope...
    For what reason would this be required?
    Maybe there could be an easier solution....

  3. #3
    Registered User
    Join Date
    10-22-2007
    Posts
    39
    seems like it would be easier than pulling out the calculator each time to update totals or to make another column just see what the new total is and then having to copy that back into the cell. Here's what I'm basically doing now:

    Week 1 - 10 -5
    Week 2 - 10 5
    Week 3 - 15 20
    Week 4 - -5 15

    So you see, each week the left number is changing and the right now is a running total that either increases or decreases based on that left number.

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,526
    Here's a little vba code you could use
    Please Login or Register  to view this content.
    right click on the sheet tab and select view codes
    copy and paste this code there
    when you change anything in range A2:A20 the next cell to the right will change accordingly

  5. #5
    Registered User
    Join Date
    10-22-2007
    Posts
    39
    Quote Originally Posted by davesexcel
    Here's a little vba code you could use
    Please Login or Register  to view this content.
    right click on the sheet tab and select view codes
    copy and paste this code there
    when you change anything in range A2:A20 the next cell to the right will change accordingly
    thats pretty nifty, how could i change it to target a certain cell instead of just the one to the right?

  6. #6
    Registered User
    Join Date
    10-22-2007
    Posts
    39
    Just noticed that its changing the values for every other cell all the way across the worksheet. Is there some way to get it focus just on changing two cells the right of the one I'm typing the number into?

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,526
    Quote Originally Posted by zb61
    Just noticed that its changing the values for every other cell all the way across the worksheet. Is there some way to get it focus just on changing two cells the right of the one I'm typing the number into?
    I am not sure what you are trying to do, but your end if's could be the problem
    example
    Please Login or Register  to view this content.
    you could fiddle with this to get it to work for you

  8. #8
    Registered User
    Join Date
    10-22-2007
    Posts
    39
    In the first column, I'm basically putting in a weekly dollar amount, and the second column that is being modified by the code is to show the dollar amount that needs to be recovered should that dollar amount in the first column be negative or lost revenue. So if that first column is a positive number then there is no money that needs to be made up so the recovery column needs to be zero because I don't want it to reflect that positive amount under recovery.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1