I have multiple data sets that looks like below in exact same format. I am trying to create a macro that subtotals in between the datasets based a particular column location. So, first subtotal column is always 12 cells to the right of the column that contains "Prod1". So, essentially macro would insert columns shaded in yellow and add up the same label columns under subtotal to that point. Note the raw data formatting includes merged cells.
Any help in the right direction would be appreciated. Thanks in advance.
Not even sure if this is the right way to think about this problem.
Excel Workbook | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | AA | AB | AC | AD | AE | AF | AG | |||
11 | * | 2011 | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | |||||
12 | * | Prod1 | Prod2 | Prod3 | SubTotal | Prod4 | Prod5 | Prod6 | SubTotal | ||||||||||||||||||||||||||
13 | * | A | B | % | C | A | B | % | C | A | B | % | C | A | B | % | C | A | B | % | C | A | B | % | C | A | B | % | C | A | B | % | C | ||
14 | Name | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | * | ||
15 | Rep1 | 12 | 5 | 42% | 0 | 12 | 5 | 42% | 0 | 12 | 5 | 42% | 0 | 36 | 15 | 42% | 0 | 12 | 5 | 42% | 0 | 12 | 5 | 42% | 0 | 12 | 5 | 42% | 0 | 36 | 15 | 42% | 0 | ||
16 | Rep2 | 27 | 0 | 0% | 0 | 27 | 0 | 0% | 0 | 27 | 0 | 0% | 0 | 81 | 0 | 0% | 0 | 27 | 0 | 0% | 0 | 27 | 0 | 0% | 0 | 27 | 0 | 0% | 0 | 81 | 0 | 0% | 0 | ||
17 | Rep3 | 9 | 0 | 0% | 0 | 9 | 0 | 0% | 0 | 9 | 0 | 0% | 0 | 27 | 0 | 0% | 0 | 9 | 0 | 0% | 0 | 9 | 0 | 0% | 0 | 9 | 0 | 0% | 0 | 27 | 0 | 0% | 0 | ||
18 | Rep4 | 14 | 0 | 0% | 0 | 14 | 0 | 0% | 0 | 14 | 0 | 0% | 0 | 42 | 0 | 0% | 0 | 14 | 0 | 0% | 0 | 14 | 0 | 0% | 0 | 14 | 0 | 0% | 0 | 42 | 0 | 0% | 0 | ||
19 | Rep5 | 35 | 0 | 0% | 0 | 35 | 0 | 0% | 0 | 35 | 0 | 0% | 0 | 105 | 0 | 0% | 0 | 35 | 0 | 0% | 0 | 35 | 0 | 0% | 0 | 35 | 0 | 0% | 0 | 105 | 0 | 0% | 0 | ||
Sheet1 |
Any help in the right direction would be appreciated. Thanks in advance.
Not even sure if this is the right way to think about this problem.