The only possible way to do this without using VBA is if the file follows a pattern in tab names of type texto + número sequencial
.
I explain:
Using the excel standard itself, the 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's a fact that the formula is extensive, but it's the only way I could identify it, I tested it here on a spreadsheet with the tabs (plan1, plan2, and plan3) and it worked perfectly.
Comments:-Forthistoworkthetabsmustbeorderedcorrectly,beingplan1
followedbyplan2
followedbyplan3
.-Thissolutioncanalsoworkforothertabnamesthatfollowthe"text + sequence number" pattern, just change the formula.