+ Reply to Thread
Results 1 to 2 of 2

Adding to a running total from another workbook

  1. #1
    Registered User
    Join Date
    07-29-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    14

    Adding to a running total from another workbook

    I have one workbook (the master file) that I update biweekly with information I get from a report. In workbook 1, I have an ID number, description, and the current total. In workbook 2, I have the ID number, description (may vary from workbook 1) and the total for the period downloaded (anything that has occurred since the last download date).

    When I say "current total" for workbook 1, it looks like this:
    =5+95+108+52+34

    or something to that nature. How can I add the new number from each new workbook 2 to the existing running total in workbook 1?

    So if the new number for the above ID in workbook 2 is 68, it would look like
    =5+95+108+52+34+68

    Any help would be greatly appreciated!

  2. #2
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: Adding to a running total from another workbook

    Hi cshort
    Welcome to the forum.
    If you are only interested in the running total and not how it is built-up then the general principle is:
    Total = Total + new value.

    In your example 'Total' would likely be cell range, lets say A30, in the master sheet and 'new value' would be your total for the period likely in a cell range, lets say WD40, in workbook 2.

    So in this case you would need to code-up the equivalent of:
    Total = Workbook 1.Master Sheet.Range("A30").Value
    new value = Workbook 2.Data update sheet.Range("WD40").Value
    Total = Total + new value
    Workbook 1.Master Sheet.Range("A30").Value = Total
    (note this is not actual code)
    Where 'Total' and 'new value' are suitably dimensioned variables

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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