Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel File path in footer of Existing Files

Status
Not open for further replies.

newcoder

MIS
Jul 3, 2001
12
US
I have employed the SubWorkbook_BeforePrint VBA to get all new files to print the path name in the excel spreadsheet footer. Works great!

But, this doesn't work for existing files - even if I save them with a new name. Does anyone have a way to get the filename and path to print in an previously existing excel document?
 
Cool - I see how to make the macro work for an open workbook - how do I make it a macro that is available for my user everytime they open a workbook ( I know how to put a macro as a toolbar button) I just don't see how to have the macro available unless the original workbook that recorded the macro is open?
 
Well, if it's just for one sheet, put the code in the Workbook_Open event
Code:
Private Sub Workbook_Open()
    With Sheets("Your Sheet Name").PageSetup
        .RightFooter = ActiveWorkbook.Path & "\" & "&F"
    End With 
End Sub


Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top