File path in Footer

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
 
D

Dave Peterson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top