Header & Footer function

B

B.

This might be an obvious answer. But, I do not know the
wording to put in my footer to show the path of where my
files is saved.

I want it to do it automatically without me typing all the
path details.

Currently I know I can do &[file] and &[tab] I try to do &
[path] that does not work.

doing an auto word insert with filename and path works in
WORD but not in excel.

Help any ideas!
 
F

Frank Kabel

Hi
you may put the following code in your workbook module:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In Me.worksheets
With wkSht.PageSetup
.Centerfooter = me.path
'.Centerfooter = me.fullname 'Alternative including path +
name of the workbook
End With
Next wkSht
End Sub
 

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