Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Full Path Names in Excel.

Full Path Names in Excel

by Allen Wyatt
(last updated September 22, 2016)

6

When you open a workbook in Excel, the workbook name is displayed in the title bar. At times, it would be nice to display more than a simple workbook name in the title bar. Many people could profit by a way to display a full path name along with the workbook name in the title bar. Unfortunately, Excel does not provide a way to do this easily.

If you only need to know the full path name once in a while, then you can create a very simple macro and assign it to the QAT or a shortcut key. When you run the macro, the information in the title bar for the active window is changed to reflect the full path name. This macro, called ChangeCaption, is as follows:

Sub ChangeCaption()
     ActiveWindow.Caption = ActiveWorkbook.FullName
End Sub

The only drawback to this approach is that whenever you rename your workbook by saving it under a different name, the new file name (and path) are not updated in the title bar unless you rerun the macro.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (7850) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Full Path Names in Excel.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Checking for Either of Two Text Values

Using a formula to find information in a text value is easy. Using a formula to find either of two text values within a ...

Discover More

Bypassing the Startup Macro

Word allows you to create a macro that is run automatically whenever the program is started. If you want to bypass the macro, ...

Discover More

Retrieving Worksheet Names

Want to grab the names of all the worksheets in a workbook? Here's how you can stuff all those names into the cells of a ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (ribbon)

Avoiding Scientific Notation on File Imports

When importing information from a CSV file, you may get unintended results from time to time. Here's how to force Excel to ...

Discover More

Getting Rid of Empty Rows after Importing

Import data into a worksheet (or paste it there) and you may find that you end up with a group of blank cells you need to get ...

Discover More

Adding a File Path and Filename

If you need to stuff the current workbook's filename and path into a cell or a header or footer, you'll appreciate the ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is four less than 9?

2016-09-24 05:49:32

Michael (Micky) Avidan

@Kevin Scanlon,
Try to add $A$1 to each and every instance of the CELL("filename") segment.
Like that:
...CELL("filename",$A$1)...
--------------------------
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2017)
ISRAEL


2016-09-23 10:37:05

Kevin Scanlon

Getting back to the point of this Tip, the suggestion to use "CELL" falls foul of the fact that this function is a volatile function and hence is re-calculated EVERY time ANY cell is changed in Excel.
This means that a "CELL" based formula located in workbook "A" will incorrectly report that it is in workbook "B" if both workbooks are open in the same instance of Excel and workbook "B" is the last one edited.
Try it and see
Kevin


2016-09-22 11:04:00

Roy

Nothing to do with this great tip, but in the latest version of Outlook if you are sending the sheet you have just worked on you can attach it quickly by just clicking on Attach file. A list of all the recent file worked on appears there.


2016-09-22 09:28:58

Kyle Fabris

I also find the "Document Location" textbox very handy. When you open a workbook, the fully qualified path is displayed. You can then copy/paste this path into any browser windows (e.g. Attach File in Outlook) thereby avoiding having to manually navigate to the file!

You can easily customize the QAT --> All Commands --> Document Location. Unfortunately, the same drawback exists. When you save a workbook, Excel doesn't automatically update the textbox like other MS Office apps do. You have to toggle to another open workbook or toggle to another application then go back to Excel for it to update.

Life is Good!

Kyle


2016-09-22 07:44:09

Michael (Micky) Avidan

@bettie lobato,
You suggestion presents the ActiveSheets name as well.
In order to present the Path and full file name only - try:
=SUBSTITUTE(LEFT(CELL("filename"),FIND("]",CELL("filename"))-1),"[",)
--------------------------
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2017)
ISRAEL


2014-05-31 14:36:29

bettie lobato

Simple way for complete path of file in Excel. On any cell in the file enter:
=cell("filename")


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.