The only possible way to do this without using VBA is if the file follows a pattern in the type tab names texto + número sequencial
.
Explain:
Using the excel standard itself, tabs have the following name:
first tab: plan1
second tab: plan2
third tab: plan3
In this case the following formula can be used, using the functions INDIRETO()
, EXT.TEXTO()
, DIREITA()
, CÉL()
, NÚM.CARACT()
and LOCALIZAR()
:
Function:
=INDIRETO("plan"&EXT.TEXTO(DIREITA(CÉL("nome.arquivo");NÚM.CARACT(CÉL("nome.arquivo"))-LOCALIZAR("]";CÉL("nome.arquivo");1));LOCALIZAR("n";DIREITA(CÉL("nome.arquivo");NÚM.CARACT(CÉL("nome.arquivo"))-LOCALIZAR("]";CÉL("nome.arquivo");1));1)+1;NÚM.CARACT(DIREITA(CÉL("nome.arquivo");NÚM.CARACT(CÉL("nome.arquivo"))-LOCALIZAR("]";CÉL("nome.arquivo");1)))-LOCALIZAR("n";DIREITA(CÉL("nome.arquivo");NÚM.CARACT(CÉL("nome.arquivo"))-LOCALIZAR("]";CÉL("nome.arquivo");1));1)+1+1)-1&"!A1")
It is a fact that the formula is extensive, but it is the only way I could identify, I tested here in a spreadsheet with tabs (plan1, plan2 and plan3) and it worked perfectly.
Comments:
- For this to work the tabs must be sorted correctly, being plan1
followed by plan2
followed by plan3
.
- This solution can also work for other tab names that follow the pattern "text + sequential number", just change the formula.
Can’t use macros, and nothing from VBA? Or only Macros? For example, could create a function.
– David
Friend, I was in doubt when exactly what you need... "get a cell value always from the tab to the left of the active tab" Can’t use a fixed reference? Tabs vary in position on your spreadsheet?
– Evert
really not. When creating a new tab the tab reference is lost, that is, it does not correspond to the previous tab.Example: Tab 3 and the cell reference refers to tab 2!C4. If I copy it the reference is maintained and should be added. Ai creates Aba 4 with reference tab 2!C4 and should be tab 3!C4. understood?
– Daniel