To understand how this works first input the following in any worksheet.
=CELL(“filename”,A1)
This formula will retrieve the file path for your workbook. Since we are only interested in the name of the worksheet, we can modify this formula with the =MID function to retrieve only that portion of the file path.
Expand upon the previous formula with the following:
=MID(CELL(“filename”,A1),FIND(“]”,CELL(“filename”,A2))+1,255)
Note: 255 characters is the maximum length for a directory path.
In the image below you will see that the formula in cell D18 (which is visible in cell D17) returns “Consolidated.”