PATH SHOW UP - HOW DO I DO THAT

D

debra

I'm trying to have the path show up on my excel documents - how do i do this?
in word you can just put this in the footer... but, excel doesn't seem to
have this capability...
 
D

Don Guillett

from a post by Gord

Sub Path_All_Sheets()
Set wkbktodo = ActiveWorkbook
For Each ws In wkbktodo.Worksheets
ws.PageSetup.RightFooter = ActiveWorkbook.FullName & " " & Chr(13) _
& Application.UserName & " " & Date
Next
End Sub


Sub PathInFooter()
ActiveSheet.PageSetup.RightFoo­ter = ActiveWorkbook.FullName & " " & _
ActiveSheet.Name & " " & Application.UserName & " " & Date
End Sub


You could also put the code into Thisworkbook BeforePrint


Gord Dibben Excel MVP
 
S

SVC

In addition to Don's excellent reply, which actually puts the information in
the footer, you can use =CELL("filename"), which will put the path in a cell
in your worksheet. If your worksheet is just one page, this might be
acceptable.
 
C

Casey55

Hi Debra, The easiest way I know of is File Pagesetup > header and footer.
Use the 'file folder icon ( &[path]&[file] ). You can also add the sheet tab
name there too.
 
G

Gord Dibben

Debra

Versions 2002 and 2003 have the path and name options in the header/footer
setup. Earlier versions require the VBA posted by Don G.

SVC

Try a little experiment with your formula.

Enter it in a cell to see path\filename and sheetname.

Leave that workbook open then open another workbook.

Hit F9 to calculate then go back to first workbook.

You will see your filename has changed to second workbook filename and
sheetname.

To prevent this use =CELL("filename",A1)


Gord Dibben Excel MVP
 
S

SVC

Interesting. Thanks for the tip. I work with Excel 2000 at work and Excel
2003 at home. Will be upgrading to Office 2003 at work soon, but greatly
appreciate the feedback.
 
Top