mountainman88
Board Regular
- Joined
- Jun 22, 2019
- Messages
- 109
- Office Version
- 2016
- Platform
- Windows
I have a workbook with 3 tabs named Summary1 - Summary3, and 7 tabs named tab1-tab7
I have a table on another tab in the workbook as below
I need VBA that loops through each column and performs the following:
1.Select summary tab named in row 1 of the table, this starts with Summary1 tab
2.for each cell on the Summary1 tab which has the string 'document' in it's cell formula, replace cell's formula with a sum formula based on the other tabs named in the column
Processing the first column in the table:
1. Select Summary1 tab
2. For each cell that contains the text 'document', replace the text/formula with:
a1=tab1!a1+tab2!a1+tab5!a1,
a2=tab1!a2+tab2!a2+tab5!a2, etc etc , and then on for every cell on the Summary1 tab
Next column in the table: Summary2, all cells that contain the text 'document' replaced by the formula:
a1=tab3!a1+tab4!a1,
a2=tab3!a2+tab4!a2,
a3=tab3!a3+tab4!a3, etc, etc
Next column in the table: Summary3, all cells that contain the text 'document' are replaced by the formula:
a1=tab7!a1,
a2=tab7!a2,
a3=tab7!a3, etc, etc
The columns can have up to 25 tabs named in them below the Summary tab name
Thanks
I have a table on another tab in the workbook as below
Cons tabs.xlsx | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | Summary1 | Summary2 | Summary3 | ||
2 | Tab1 | Tab3 | Tab7 | ||
3 | Tab2 | Tab4 | |||
4 | Tab5 | ||||
Sheet2 |
I need VBA that loops through each column and performs the following:
1.Select summary tab named in row 1 of the table, this starts with Summary1 tab
2.for each cell on the Summary1 tab which has the string 'document' in it's cell formula, replace cell's formula with a sum formula based on the other tabs named in the column
Processing the first column in the table:
1. Select Summary1 tab
2. For each cell that contains the text 'document', replace the text/formula with:
a1=tab1!a1+tab2!a1+tab5!a1,
a2=tab1!a2+tab2!a2+tab5!a2, etc etc , and then on for every cell on the Summary1 tab
Next column in the table: Summary2, all cells that contain the text 'document' replaced by the formula:
a1=tab3!a1+tab4!a1,
a2=tab3!a2+tab4!a2,
a3=tab3!a3+tab4!a3, etc, etc
Next column in the table: Summary3, all cells that contain the text 'document' are replaced by the formula:
a1=tab7!a1,
a2=tab7!a2,
a3=tab7!a3, etc, etc
The columns can have up to 25 tabs named in them below the Summary tab name
Thanks
Last edited: