Use the formula anywhere on the sheet to get the sheet name - for the sheet you must have a file name for this:
=REPLACE(CELL("filename"),1,FIND("]",CELL("filename")),"")
You can reference this cell using indirect:
=SUM(Indirect("'"&A1&"'!B:B"))
or, if you do not want to have a second cell, you can combine the two formulas into one:
=SUM(INDIRECT("'"&REPLACE(CELL("filename"),1,FIND("]",CELL("filename")),"")&"'!B:B"))
Seanc source share