GriffinsPal
New Member
- Joined
- Apr 14, 2014
- Messages
- 40
I have a workbook that has several worksheets. In each worksheet column C contains the month. I want to total certain data within a worksheet by month and copy it to a table in another worksheet within the workbook. Generally each worksheet has its own data type to be totaled, but there are some data types that are in more than one worksheet and I want the total for that data type to reflect the sum of that data across all the worksheets in which it appears. So in the first situation I think I would use something like this:
This would (I think) find all the rows in which column C contains a 1 (January), add the data in those rows that are found in column Q and then copy that sum into cell H18 in the Totals workbook.
1. I want to do this for every month (1-12) so is there a more concise way of doing that without copying this formula 11 more times?
2. Let's say I want to combine data from column Q in the "training" worksheet and column r from the "screening" worksheet into a single total in the "Totals" worksheet, should I create dummy (temporary) totals of from each worksheet and then add the two dummy totals and copy them to the "totals" page, or is there a better way of writing this?
thank you so much for your help!
Code:
With Sheets("trainings")
SumIf(c3:c150,1,Q3:Q150).copy sheets("totals").range H18
This would (I think) find all the rows in which column C contains a 1 (January), add the data in those rows that are found in column Q and then copy that sum into cell H18 in the Totals workbook.
1. I want to do this for every month (1-12) so is there a more concise way of doing that without copying this formula 11 more times?
2. Let's say I want to combine data from column Q in the "training" worksheet and column r from the "screening" worksheet into a single total in the "Totals" worksheet, should I create dummy (temporary) totals of from each worksheet and then add the two dummy totals and copy them to the "totals" page, or is there a better way of writing this?
thank you so much for your help!