+ Reply to Thread
Results 1 to 11 of 11

excel addition tip

  1. #1
    Registered User
    Join Date
    05-28-2010
    Location
    Maldives
    MS-Off Ver
    Excel 2007
    Posts
    15

    excel addition tip

    can anyone please help me in this task. i have tried but im sill unable to do so.

    im using microsoft excel 2007

    im using two cells. one cell is for the total and the other cell to enter the figure. what i want to do is delete the figure in the cell that i entered before and enter a new figure but to add this figure to the to the total figure and repeat this again and again. but when i tried to do this by using the sum function this did not work. when i use the sum formula, when i delete the figure in the figure cell the total also get deleted.


    can anyone please help me with this through excel

  2. #2
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: excel addition tip

    Hi, if you need to add the new figure on the old number, you could write the new figure in a third cell and use copy and paste special choosing the option "add" on the old number.

    Hope it helps you

  3. #3
    Registered User
    Join Date
    05-28-2010
    Location
    Maldives
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: excel addition tip

    its not what i meant. anyways thanks. but is there anyway the new number can be added to the old automatically as i add a new figure to the second cell. what goes wrong is that when i delete or replace the new figure from the second cell, it also deletes the previous figure from the total cell

  4. #4
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: excel addition tip

    Hi Abdulla,
    as far as I know - but I'm a freshman compared to the experts of the Forum- you can not do it without a VBA routine.

    I hope someone can offer a better answer than mine.

    Regards

  5. #5
    Forum Contributor
    Join Date
    02-25-2010
    Location
    Boston
    MS-Off Ver
    Excel 2007
    Posts
    174

    Re: excel addition tip

    You are correct, itterations can only be done via VBA.

    Once the value is changed int he original cell it is not stored for further use, nor is there any way to set order of cell operations.

  6. #6
    Registered User
    Join Date
    05-28-2010
    Location
    Maldives
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: excel addition tip

    can anyone please help me to do this task through VBA

  7. #7
    Forum Contributor
    Join Date
    02-25-2010
    Location
    Boston
    MS-Off Ver
    Excel 2007
    Posts
    174

    Re: excel addition tip

    How many times do you want this to repeat?

  8. #8
    Registered User
    Join Date
    05-28-2010
    Location
    Maldives
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: excel addition tip

    i want to do it idefinitely unlimited or its ok if its for about 500 times

  9. #9
    Forum Contributor
    Join Date
    02-25-2010
    Location
    Boston
    MS-Off Ver
    Excel 2007
    Posts
    174

    Re: excel addition tip

    Well if you do it indefinately you will end up with a broken workbook with unending code.

    Does your value appraoch some other value and then stop? Or it just keeps going...?

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: excel addition tip

    This code will work how you seem to want.

    Enter numbers in A1 to increase/decrease B1
    Please Login or Register  to view this content.

    This code is Worksheet Event code, and will run automatically when something specific occurs in the sheet. If you type in a cell (A1), and press the Enter key, the worksheet has been changed. This will trigger the Worksheet_Change event and change B1.

    Worksheet event code is stored in the worksheet module. To add it to your worksheet, do the following:

    Copy the code
    Select the worksheet in which you the code to run
    Right click on the sheet tab and choose View Code, to open the Visual Basic Editor.
    Where the cursor is flashing, choose Edit | Paste
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  11. #11
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: excel addition tip

    Please Login or Register  to view this content.
    Put the code in the appropriate Sheet module:

    Adding Code to a Sheet module
    1. Copy the code from the post
    2. Right-click on the tab for the relevant sheet and select View Code. This opens the Visual Basic Editor (VBE) and shows the object module for the selected worksheet.
    3. Paste the code in the window
    4. Press Alt+Q to close the VBE and return to Excel

    EDIT: That Roy is fast!
    Entia non sunt multiplicanda sine necessitate

+ 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