English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

In VB, you can put filenames, tab names, time & date, etc. in headers and footers using formatting codes (&F for filename, &A for tab name, etc.).

Is there a code for the file path, or is there some other way to insert the path? I have 2003.

2007-09-24 03:16:47 · 2 answers · asked by aladou 5 in Computers & Internet Software

My code looks like this, and I'd like to also include the path before the filename (&F):

With ActiveSheet.PageSetup
.LeftFooter = "&F - &A"
.CenterFooter = "&P"
.RightFooter = "&D, &T"
End With

2007-09-24 03:21:33 · update #1

computer guy, thanks, but when you do it "manually" through view headers/footers, it shows [Path], which doesn't work as a format code in VB.

2007-09-24 03:30:14 · update #2

2 answers

If you want to include the full pathname including the filename at the end do it like so:

.RightFooter = "&Z&F"

If you want just the path without the filename at the end like you are giving the directory then do it like so:

.LeftHeader = "&Z"

It sounds like you want to do the first of my two examples.

2007-09-26 05:00:26 · answer #1 · answered by devilishblueyes 7 · 0 0

yes, if you view headers / footers, you will see the custom header / footer, try those. if you do not see what you are looking for, open ms word and get the codes from there

2007-09-24 10:22:04 · answer #2 · answered by Anonymous · 0 0

fedest.com, questions and answers