Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Faster footer changing

Status
Not open for further replies.

Fherrera

Technical User
May 11, 2004
129
CA
Hi, i've found a way to change the footer values, and I run this at the 'on_open' event of the workbook. The only problem is that this is a bit slow... The code is here:

Code:
    With Unit1.PageSetup
        .LeftFooter = "&12" + ThisWorkbook.Path + "\" + ThisWorkbook.name
    End With

My question, (may be OT to this forum) is there a special code that I can just put into the footer that will always give me the current working directory/full file name & path instead of having to use VBA? Like &something or anything?

Frank
 
I forgot to mention I was referring to Excel 97. I can't find the Field selection in the Insert menu? Also, I noticed I can get the filename from the buttons in the Page Setup->Custom Footer dialog box, but I'd like the whole path. (current path)

THanks

Frank
 
Oops, yes, ThisWorkbook does kind of give a clue you're using Excel! I'm sure I've done this before, but just had a look & it's certainly not obvious, I'll think on it & get back to you if I have any inspiration.
 
Try &Z&F

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks for the reply PHV, but &Z doesn't seem to do anything for me (just stays as &Z) the &F turns into &[File] and gives the filename. Maybe it's because i'm using Excel 97?

Frank
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top