Displaying pathname in the header

S

schoujar

Hi,

I just can't seem to figure out how to display the path of the file in
the header.

I've used &DD and &[Path] to no avail.

Thankx in advance

Sahil
 
D

dominicb

Good morning schoujar

What version of Excel do you have? If memory serves me correct the
Excel 2002 onwards can do this, but if you're using Excel 97/2000 the
a macro can be done to do this for you:

Sub SetHeader()
ActiveSheet.PageSetup.LeftHeader = ActiveWorkbook.FullName
End Sub

is all that's needed. If you don't want a left header then replac
"LeftHeader" with one of:

CenterHeader
RightHeader
LeftFooter
RightFooter
CenterFooter

HTH

Dominic
 
Top