Forum Discussion

Nigel Hammacott's avatar
Nigel Hammacott
Copper Contributor
Feb 28, 2018

Formula for Cell Value as Worksheet name

Hi there, 

 

I have been using the below formula to make cell A1 in my worksheet display as the worksheet name tab (lets call it sheet 1). This works fine apart from when I go to a alternate worksheet (lets call it sheet 2) and make a change there. after I do this the value in cell A1 in sheet 1 changes to 'sheet 2'.

 

=MID(CELL("filename"),FIND("]",CELL("filename"))+1,1255)

 

any ideas what I'm doing wrong would be appreciated

 

  • Haytham Amairah's avatar
    Haytham Amairah
    Silver Contributor

    Hi Nigel,

     

    You have to specify a reference to the CELL function on the current worksheet!

     

    So replace that formula with this:

    =MID(CELL("filename",A1),FIND("]",CELL("filename"))+1,1255)

     Or this:

    =RIGHT(CELL("filename",A1),LEN(CELL("filename",A1))-SEARCH("]",CELL("filename",A1)))

Resources