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!
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:
Where 'Total' and 'new value' are suitably dimensioned variablesTotal = 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)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks