+ Reply to Thread
Results 1 to 8 of 8

Adding numbers from a single cell

  1. #1
    Registered User
    Join Date
    09-18-2008
    Location
    Kansas
    Posts
    5

    Adding numbers from a single cell

    I need help with a formula. I need to add different numbers from a single cell. For example I need to be able to enter an 8, delete the 8, then enter an10 in the same cell and the total to come up as 18. Any help would be greatly appreciated.

  2. #2
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    This can be done using VBA. This basic code can do the trick. Adapt it as necessary.



    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-18-2008
    Location
    Kansas
    Posts
    5
    I'm relatively new to excel and I'm not sure how to enter that information into Excel. I have never used VBA before.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

  5. #5
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    Quote Originally Posted by hri1428 View Post
    I'm relatively new to excel and I'm not sure how to enter that information into Excel. I have never used VBA before.
    If you are new to VBA, your best bet is to post a sample of your workbook so we can see your formatting and layout. This is important because it will help us trap for errors and troubleshoot any potential problems before they occur.

    If you would prefer to just put the code in yourself, right click on the sheet tab that you want the code to be applied to (ie, Sheet1). One of the options should be View Code. Once you click that, the VBE will open up and a dialog box will have the focus. Simply copy and paste my code into the dialog box.

    Let me know if it works.

  6. #6
    Registered User
    Join Date
    09-18-2008
    Location
    Kansas
    Posts
    5
    How do I apply the code to the specific cell or cells that I want the sum in?

  7. #7
    Registered User
    Join Date
    09-18-2008
    Location
    Kansas
    Posts
    5
    For example I need to be able to put 8 in A1, 7 in A2 and have the total of 15 in A3. I then need to be able to go back and delete the 8 and the 7 and have the total in A3 remain 15. Then I need to be able to put a 7 in A1 an 8 in A2 and have the total in A3 be 30.

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    use the example i posted
    in that it says select c3 but thats just an example
    select say a1 and run the set comment macro
    then select b1 and do the same
    in c1 put =a1+b1
    now if you put 1 in a1 ,1 in b1 then c1 will show 2
    put 7 in a1 c1 will show 9 and so on
    to clear simply select cells a1 and or b1 and clear comments, then you'd have to re-run the set comment macro again for each cell.
    also go to tools/options if you want and under view select the option for comments you wish to be displayed (comment indicator only is best as it reminds you something is in those cells,then view coments will show the running total in each)
    don't forget to save workbook on exit
    Last edited by martindwilson; 09-18-2008 at 07:04 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Adding numbers within a total
    By michaelas in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-27-2008, 04:51 PM
  2. read cell content and use with Hyperlinks.Add Cell
    By apoc [t.i.m.] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-04-2007, 10:02 AM
  3. using cell content to reference a worksheet tab name in second workbook
    By Conor in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-29-2007, 09:32 AM
  4. Keep cell adding after data is deleted
    By pinhead1 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 06-07-2007, 05:15 PM
  5. Linking multiple cell data to a single cell
    By matt92 in forum Excel General
    Replies: 5
    Last Post: 03-14-2007, 01:54 AM

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