Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Inserting File name and path in Excel 2007 Documents
We are trying to figure out how to insert the file name and path in Excel
2007. We are also looking for the same in Word 2007. Is it possible to create a macro or shortcut for this that we can place in the quick access bar? -- Christine |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Inserting File name and path in Excel 2007 Documents
You can use the following function called from a worksheet cell, to return
either the filename only (e.g., "SomeFile.xls") or the fully qualified file name (e.g., "C:\SomePath\SomeFolder\SomeFile.xls"). Function FileName(Optional ShortName As Boolean = False) As String With Application.Caller.Parent.Parent FileName = IIf(ShortName, .Name, .FullName) End With End Function You would then call this with =FileName(TRUE) ' file name only or either of =FileName(FALSE) ' full file name =FileName() ' full file name -- Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2008 Pearson Software Consulting, LLC www.cpearson.com (email on web site) "Christine" wrote in message ... We are trying to figure out how to insert the file name and path in Excel 2007. We are also looking for the same in Word 2007. Is it possible to create a macro or shortcut for this that we can place in the quick access bar? -- Christine |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Inserting File name and path in Excel 2007 Documents
Insert the filename and path where?
In a header or footer? I don't use 2007 but 2002 and 2003 versions had a path and filename icon in Custom Footers and Headers under print setup. I can't believe Excel 2007 wouldn't have the same feature. Macro if you want one. Sub PathInFooter() ActiveSheet.PageSetup.RightFooter = ActiveWorkbook.FullName & " " & _ ActiveSheet.Name & " " & Application.UserName & " " & Date End Sub Gord Dibben MS Excel MVP On Tue, 15 Jan 2008 15:46:02 -0800, Christine wrote: We are trying to figure out how to insert the file name and path in Excel 2007. We are also looking for the same in Word 2007. Is it possible to create a macro or shortcut for this that we can place in the quick access bar? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
User wants to see full path in recent documents Excel 2007 | Excel Discussion (Misc queries) | |||
How can I automatically print file path on documents | Excel Discussion (Misc queries) | |||
Excel 2007 add-in with file path showing | Excel Discussion (Misc queries) | |||
Inserting File Path name | Excel Discussion (Misc queries) | |||
Inserting Field To Insert Full Path to Excel File | Excel Discussion (Misc queries) |