Sie sind auf Seite 1von 1

Excel Automatically Updating Page Titles for Sheets

Has anyone ever asked you how to automatically link a cell to the title of a sheet? For example, if the current
worksheet is called "Sheet1," how do you link to this name such that a change in the name will be reflected in your
cell link?

You might be in the process of creating a product model in which there are 25 different products, and each
product occupies a sheet within the model. Let's say that you name each sheet for each different product, and
have a title on each sheet that also matches the name of the product. If you decide to change the nomenclature,
you may be making 25 changes twice over (or even more than that, if you are using the product name in multiple
cells on each sheet).

How do we link to sheet names?

Obviously, the more you link things together, the less manual updating you will need to do. So here is a way to link
to a sheet name, for whatever purpose you might need (make sure your file is saved on the hard drive).

1. Start with a formula that will return a string of text containing the sheet name. Assume you are on
"Sheet1." You can go to cell B3 and enter: =+CELL("filename",$B$3), which returns
"C:\Folder\[filename.xlsx]Sheet1"

2. Having the filepath and sheet name, you can create a function that returns only the part of this string of
text that follows the "]," which would be "Sheet1"

3. One function that will work to return only the text following "]" is the RIGHT function:
=+RIGHT(CELL("filename",$B$3),a) where a is the number of characters following "]"

4. Obviously, if all of your sheet names are 6 characters in length, you can just use the function from step 3
with a = 6,. But a truly dynamic function will require solving for "a" in all cases. So first, let's assume a = b
- c, where b is the total length of the filename and c is the total number of characters through "]"

5. Find "b," use =+LEN(CELL("filename",$B$3)), which tells you that the filename is 31 characters in length

6. To find "c," use =+SEARCH("]",CELL("filename",$B$3),1), which tells you that "]" occupies the 25th
position starting from the left in "C:\Folder\[filename.xlsx]Sheet1"

7. Using a = b - c, we have a = 31 - 26 = 5. In formulaic terms, a = LEN(CELL("filename",$B$3))-


SEARCH("]",CELL("filename",$B$3),1)

8. Thus, using the formulae from steps 3 and 7, the sheet name is
=+RIGHT(CELL("filename",$B$3),LEN(CELL("filename",$B$3))-SEARCH("]",CELL("filename",$B$3),1))

Holy sheet!

Das könnte Ihnen auch gefallen