To understand how this works first input the following in any worksheet.
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:
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.”