abbab
10-25-2012, 12:00 PM
I receive monthly files detailing metrics we need to report on quarterly. In each file there is a separate tab for each site with the metrics for that site as well as a summary sheet. Information on the summary sheet is calculated using the following formula: =COUNTIF('Site - Site 1'!I5:I300,'Summary - By Site'!H3). The cells the data is in never changes.
We have a quarterly file that we use to compile the information each month. The quarterly file is set up similarly to the monthly file with tabs for each site and then a summary tab. I have been using the following array to pull the information from the monthly files to the quarterly file.
=IF(ISNA(VLOOKUP($A3, ('[FILE LOCATION AND NAME]Summary - By Site'!$H$3:$I$25),2,FALSE)),0,VLOOKUP($A3, ('[FILE LOCATION AND NAME]Summary - By Site'!$H$3:$I$25),2,FALSE))
This works, but is cumbersome. I need to do a find/replace to change the file name for each month and then do a find/replace to update where to pull the location from each site (i.e. site 1 will also be in $A$2:$B$11, site 2 will always be in $C$2:$D$11 so on and so forth…). To make matters worse, every time I run the array a dialog box appears asking me to navigate to the file where the information is stored.
I am looking for a way to pull the information for each month and update the location of the data for each site that is easier and less cumbersome than this and avoids having the dialog box appear every time a file location is mentioned. (If is that even possible?) The naming conventions for the monthly files never change. Data will always need to be pulled from ‘Monthly Report – January’, ‘Monthly Report – February’, etc. and the same cells will always be referenced each month. It is just the month that changes and the cell reference for each site. I have attached a sample file in case anyone would like to reference it.
I am new to VBA so simplicity is best. Please let me know if you have any questions.
Thank you in advance,
Abby
We have a quarterly file that we use to compile the information each month. The quarterly file is set up similarly to the monthly file with tabs for each site and then a summary tab. I have been using the following array to pull the information from the monthly files to the quarterly file.
=IF(ISNA(VLOOKUP($A3, ('[FILE LOCATION AND NAME]Summary - By Site'!$H$3:$I$25),2,FALSE)),0,VLOOKUP($A3, ('[FILE LOCATION AND NAME]Summary - By Site'!$H$3:$I$25),2,FALSE))
This works, but is cumbersome. I need to do a find/replace to change the file name for each month and then do a find/replace to update where to pull the location from each site (i.e. site 1 will also be in $A$2:$B$11, site 2 will always be in $C$2:$D$11 so on and so forth…). To make matters worse, every time I run the array a dialog box appears asking me to navigate to the file where the information is stored.
I am looking for a way to pull the information for each month and update the location of the data for each site that is easier and less cumbersome than this and avoids having the dialog box appear every time a file location is mentioned. (If is that even possible?) The naming conventions for the monthly files never change. Data will always need to be pulled from ‘Monthly Report – January’, ‘Monthly Report – February’, etc. and the same cells will always be referenced each month. It is just the month that changes and the cell reference for each site. I have attached a sample file in case anyone would like to reference it.
I am new to VBA so simplicity is best. Please let me know if you have any questions.
Thank you in advance,
Abby