A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Assuming you never have apostrophes in the sheet names, you could add another SUBSTITUTE function:
=SUBSTITUTE(SUBSTITUTE(LEFT(FORMULATEXT(B1),FIND("!",FORMULATEXT(B1))-1),"=",""),"'","")