![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Posts: 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 |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 2,908
|
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 HTH, D [ This Message was edited by: dk on 2002-03-07 09:45 ] |
|
|
|
|
|
#3 |
|
New Member
Join Date: Feb 2002
Posts: 40
|
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 |
|
|
|
|
|
#4 |
|
New Member
Join Date: Feb 2002
Posts: 40
|
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
|
|
|
|
|
|
#5 |
|
New Member
Join Date: Feb 2002
Location: Louisiana USA
Posts: 26
|
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.
|
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 2,908
|
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 |
|
|
|
|
|
#7 |
|
New Member
Join Date: Feb 2002
Posts: 40
|
Thanks, folks -- after some fumbling around, this works just right.
Lindsay |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|