this seems like this would affect the "Master_Imp" file rather than the source file
Yes think of "Master_Imp" as your trained seal who can do certain tricks. If you wish it to perform a new trick it must be taught to do so i.e. code must be rewritten. On the other hand you don't have to encourage it with a fish every time you wish it to perform.
As this code is written for looping through all files in a folder and extracting data the basic functions are still valid. What has change is that instead of summing a column you just wish to get the sum for the last 30 days.
First you need to change the line
to
as I'm adding an extra integer in order to sum the last 30 days.
Then I wish to test if the column to sum contains at least values for 30 days or more and if so change my sum formula.
Replace these lines
with
The code now checks if j is equal to or greater than 31 (As first row contains headings data goes from row 2 to ???)
If this condition is fulfilled the sum formula is rewritten to sum just the last 30 days. If not it sums just available data in column.
I'm not to happy about that as you don't know if your result is based on the last 30 days or less data than 30 days. It is possible to add extra information in "Master_Imp.xlsm" of how may rows with data was found in active sheet or that sheet could be skipped. You have a think about this problem and how you would like it solved.
On a previous posting you had this question
if I want to make a new column that sums up the last 30 days of activity
Not sure if I've answered that or have I?
Alf
Bookmarks