• In a workbook, I have one main tab and anywhere from 10 to 100+ tabs.
• With help from the internet, I have defined a name, "SheetNames" and placed this formula, =REPLACE(GET.WORKBOOK(1),1,FIND("]",GET.WORKBOOK(1)),""), in the Refers to box.
• Row 1 has column headers
• In Column A, starting at A2 I put the formula =Row()-1 to be used in Column B as a tab reference
• In Column B, starting with B2, I put the formula =@INDEX(SheetNames,A2) for as many sheets as I have in the workbook
Which looks like this:
What I want is a formula starting in D2 that will find the identify the last row in each sheet and starting in E2, a formula that will identify the last column in each sheet. Ideally, I do not want to use a macro to do this but rather a formula.
Any help would be greatly appreciated!!!!
• With help from the internet, I have defined a name, "SheetNames" and placed this formula, =REPLACE(GET.WORKBOOK(1),1,FIND("]",GET.WORKBOOK(1)),""), in the Refers to box.
• Row 1 has column headers
• In Column A, starting at A2 I put the formula =Row()-1 to be used in Column B as a tab reference
• In Column B, starting with B2, I put the formula =@INDEX(SheetNames,A2) for as many sheets as I have in the workbook
Which looks like this:
2022-05-31 COMPARE TWO XL FILES WITH MANY SHEETS.xlsm | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | Index | SheetName | Link | MAX ROW | MAX COL | ||
2 | 1 | TabList | TabList | ||||
3 | 2 | Sheet0 | Sheet0 | ||||
4 | 3 | Sheet1 | Sheet1 | ||||
5 | 4 | Sheet2 | Sheet2 | ||||
6 | 5 | Sheet3 | Sheet3 | ||||
7 | 6 | Sheet4 | Sheet4 | ||||
8 | 7 | Sheet5 | Sheet5 | ||||
9 | 8 | Sheet6 | Sheet6 | ||||
TabList |
Cell Formulas | ||
---|---|---|
Range | Formula | |
A2:A9 | A2 | =ROW()-1 |
B2:B9 | B2 | =INDEX(SheetNames,A2) |
C2:C9 | C2 | =HYPERLINK("#'"&B2&"'!A1",B2) |
What I want is a formula starting in D2 that will find the identify the last row in each sheet and starting in E2, a formula that will identify the last column in each sheet. Ideally, I do not want to use a macro to do this but rather a formula.
Any help would be greatly appreciated!!!!