FIND(“]”,FilePath) will return the location of the “]” character before the sheet name (let’s call this the Location). In our example FIND(“]”,FilePath) returns the value 132 since “]” is the 132nd character in the FilePath text string. LEN(FilePath) will return the total character length of the FilePath text string (let’s call this the TotalLength). In our example LEN(FilePath) returns the value 140 since there are 140 characters in the text string. We can now get the length of the sheet name by subtracting TotalLength-Location. In our example the sheet name length is 140-132=8 characters. RIGHT(FilePath,TotalLength-Location) will then return the right most 8 characters of the FilePath, which gives us the sheet name. In our example this is My Sheet.

How to Get the Current Sheet Name - 66