I'm trying to build a summary worksheet that will consist largely of rows of formulas that calculate minima, averages, maxima, and other results from data in other worksheets in the same workbook. I know the correct formulas. I know how to specify the range of data to be used within each worksheet. I know the names of the worksheets. What I don't know is how to build a macro that will properly populate each calculation cell in the summary worksheet that will properly name the worksheet and range the formula is to apply to.
For simplicity's sake, let's say three of the worksheets are named AAP, QAR, and QFR and use the basic MIN, AVERAGE, and MAX functions: =MIN('Worksheet Title'!Worksheet_Range), =AVERAGE('Worksheet Title'!Worksheet_Range), and =MAX('Worksheet Title'!Worksheet_Range). Let's say that the ranges (each a column of cells that will vary in length each month when this data is pulled), should be named XXX_Time_Viewed, XXX_Time_Percent, XXX_Slides_Viewed, and XXX_Slides_Percent, where XXX refers to the worksheet name. And let's say the rows on the summary worksheet have the same titles (first column) as the worksheets they refer to.
It seems like there should be a compact way for a macro to populate each cell in each row with the correct formula which points to the correct worksheet and range. Maybe with a for...each loop (or several) that references one or more arrays containing the worksheet names and/or ranges?
Or would it be better take a different approach entirely--say, do all the calculations on the source worksheets and only copy the results to the summary sheet?
If that's too unclear, I can upload a conceptual example of what this summary worksheet would look like.
For simplicity's sake, let's say three of the worksheets are named AAP, QAR, and QFR and use the basic MIN, AVERAGE, and MAX functions: =MIN('Worksheet Title'!Worksheet_Range), =AVERAGE('Worksheet Title'!Worksheet_Range), and =MAX('Worksheet Title'!Worksheet_Range). Let's say that the ranges (each a column of cells that will vary in length each month when this data is pulled), should be named XXX_Time_Viewed, XXX_Time_Percent, XXX_Slides_Viewed, and XXX_Slides_Percent, where XXX refers to the worksheet name. And let's say the rows on the summary worksheet have the same titles (first column) as the worksheets they refer to.
It seems like there should be a compact way for a macro to populate each cell in each row with the correct formula which points to the correct worksheet and range. Maybe with a for...each loop (or several) that references one or more arrays containing the worksheet names and/or ranges?
Or would it be better take a different approach entirely--say, do all the calculations on the source worksheets and only copy the results to the summary sheet?
If that's too unclear, I can upload a conceptual example of what this summary worksheet would look like.