Path and file name in header


Posted by Eric on August 06, 2001 11:20 AM

How do I put the path and file name in the header automatically? The only button I see is for the filename, not the path.



Posted by Joe Chin on August 06, 2001 12:29 PM

You can use the following macro:

sub AddHeader()
dim wks as worksheet

for each wks in thisworkbook.worksheets
wks.PageSetup.LeftHeader = thisworkbook.path & "\" & thisworkbook.name
next
end sub