File path in Footer

  • Thread starter Thread starter Kevin
  • Start date Start date
K

Kevin

I need the file path that can be inserted into a custom
footer to be inserted into a cell so that it cannot be
changed. Is there any way to do this?
Thanks
 
I don't think you can protect this -- the best I've been able to do is just
reset it before I print.

You can use some code to do it. the code goes under the ThisWorkbook module:

Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)

Dim wks As Worksheet

For Each wks In Me.Worksheets
wks.PageSetup.LeftFooter = me.fullname
Next wks

End Sub

John Walkenbach has a pretty nice addin at:
http://j-walk.com/ss/excel/files/addpath.htm
That actually creates the code.


If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Back
Top