k3yn0t3
New Member
- Joined
- Oct 5, 2023
- Messages
- 42
- Office Version
- 365
- Platform
- Windows
Hi all. Could anyone help me with a macro that will allow me to duplicate the sheet shown below and ensure the following:
Sam
- Increase the Factory number in D7 by 1 each time...
- Rename the sheet based on the number in that cell
- i.e., there should be ~200 tabs named "Factory_1", "Factory_2"..."Factory_200" and so on
- All formulas are included when sheet is copied, and update accordingly (i.e. formulas with "Factory_1" in them update for Factory # of their new sheet)
Sam
Factories_v22.xlsx | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
C | D | E | F | G | H | I | J | K | L | M | N | |||
7 | Factory | 1 | ||||||||||||
8 | ||||||||||||||
9 | Q1 | Q1 | Q2 | Q2 | Q2 | Q3 | ||||||||
10 | 2 | 3 | 4 | 5 | 6 | 7 | ||||||||
11 | 2018 | 2018 | 2018 | 2018 | 2018 | 2018 | ||||||||
12 | Transactions | 21,656 | 27,812 | 20,327 | 19,475 | 23,883 | 18,354 | |||||||
13 | ||||||||||||||
14 | Net Sales | 586 | 766 | 544 | 508 | 613 | 477 | |||||||
15 | COGS | -179 | -232 | -162 | -152 | -180 | -139 | |||||||
16 | Gross Profit | 406 | 534 | 381 | 357 | 433 | 337 | |||||||
17 | Labor | -156 | -206 | -153 | -154 | -187 | -149 | |||||||
18 | OpEx | -78 | -89 | -78 | -78 | -86 | -74 | |||||||
19 | Occupancy | -12 | -16 | -12 | -12 | -16 | -12 | |||||||
20 | EBITDA | 159 | 223 | 137 | 113 | 144 | 102 | |||||||
Factory_1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
I12:N12,I14:N14 | I12 | =+FILTER(INDEX('Factory Database'!$P$8:$MM$109,MATCH(Factory_1!$D$7,'Factory Database'!$A$8:$A$109,0),0),('Factory Database'!$P$6:$MM$6=Factory_1!I$11)*('Factory Database'!$P$5:$MM$5=Factory_1!I$10)*('Factory Database'!$P$7:$MM$7=Factory_1!$C12),0) |
I15:N15,I17:N19 | I15 | =-+FILTER(INDEX('Factory Database'!$P$8:$MM$109,MATCH(Factory_1!$D$7,'Factory Database'!$A$8:$A$109,0),0),('Factory Database'!$P$6:$MM$6=Factory_1!I$11)*('Factory Database'!$P$5:$MM$5=Factory_1!I$10)*('Factory Database'!$P$7:$MM$7=Factory_1!$C15),0) |
I16:N16 | I16 | =+I15+I14 |
I20:N20 | I20 | =+SUM(I16:I19) |