Insert path name into footnote?

chezlinds

New Member
Joined
Feb 25, 2002
Messages
40
Help! My supervisor is used to Lotus and wants the location of the documents (eg. c:/blah/blahdeblah.xls) inserted into the footer. I know I've read something about this functionality on this site, but I can't track down the tip. Any ideas?

Thanks,
Lindsay
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
You can do this using a very small piece of VBA code. Right click the lower of the 2 Excel icons at the top left of the screen and choose View Code. Then paste this:-

Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.LeftFooter = ThisWorkbook.FullName
End Sub

If you want it for all workbooks then it's a bit (a lot) more tricky without having to add this code to each individual workbook. Let me know and I'll post the code required.

HTH,
D
This message was edited by dk on 2002-03-07 09:45
 
Upvote 0
dk, thank you for your help. I am totally ignorant of VBA, so please bear with me. Sorry for displaying such ignorance, but this is a "we need this yesterday" kind of situation, so no time to go get a book or anything sensible like that...

After I've pasted this code, then what? Do I just close the editor, or is there a way to save my changes?

Lindsay
 
Upvote 0
also, I'll just deal with the small piece of code right now and worry about other workbooks later. No need to get any more complicated :smile:
 
Upvote 0
Just past the code where DK asked you to. Yes, close the editor and save the file. When any worksheet is printed from the workbook the filename and it's location will be printed out on the footer of each sheet.
 
Upvote 0
To add to what Sam said. You must make sure that the code is in the workbook code module, not in a standard module (hence the right click and View Code - this opens the workbook code module). The code will also work when doing print preview. If you try it you'll se the path in the print preview window.

Regards,
D
 
Upvote 0

Forum statistics

Threads
1,223,406
Messages
6,171,926
Members
452,434
Latest member
NUC_N_FUTS2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top