I have an Excel file with several sheets with data and I have a "main" sheet called summary. To explain let say that in my workbook I have the four sheets : "summary", "apple", "orange" and "lemon". I organized the summary sheet so that by settings the value of cell B2 I can get the data from the other sheets. So if B2 = orange I have some data from the sheets "orange" and if I set B2 = lemon I get the same data from the sheet lemon.
What I am not able to do is to define a formula to get the last non empty cell in the selected sheet.
I found this formula in this forum to select the last non empty formula in a column:
=MAX((A:A<>"")*(ROW(A:A)))
What I would like to do is to edit this formula so that if
B2 = Orange
the formula becomes
=MAX((Orange!A:A<>"")*(ROW(Orange!A:A)))
and if
B2 = Apple
the formula becomes
=MAX((Apple!A:A<>"")*(ROW(Apple!A:A)))
I tried editing the formula by using INDIRECT
=MAX((INDIRECT("'"&$B$2&"'!A:A")<>"""")*(ROW(INDIRECT("'"&$B$2&"'!A:A"))))
but the result I get is always 1048576 (the last admissible row in my excel).
Can you please help me?