If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > file path on sheet

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-05-05, 09:41
surfacesys surfacesys is offline
Registered User
 
Join Date: Mar 2004
Location: Greenville, SC
Posts: 271
file path on sheet

Is there a way to list the path of the current sheet in the footer or at the bottom of the page? ie: C:\MyDocuments\Company\Personnel\Employee.xls

Thank You,
Michael
__________________
Gotta to do some code
Reply With Quote
  #2 (permalink)  
Old 01-05-05, 13:36
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Of course, if you have XL2002 or XL2003 this is built in, so you don't need this code.

Otherwise:
Code:
Sub CustomFooter()
'   Inserts the file name and path into the page footer
'   for each sheet in the active workbook
    Dim sht as Worksheet
    For Each sht In ActiveWorkbook.Sheets
        sht.PageSetup.LeftFooter = ActiveWorkbook.FullName
    Next sht
End Sub
Change the placement with: RightFooter or CenterFooter
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #3 (permalink)  
Old 01-05-05, 14:48
surfacesys surfacesys is offline
Registered User
 
Join Date: Mar 2004
Location: Greenville, SC
Posts: 271
Thank you very much!

Is there a way to enter this in a formula on the spread sheet?
__________________
Gotta to do some code
Reply With Quote
  #4 (permalink)  
Old 01-05-05, 16:27
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
=SUBSTITUTE(LEFT(CELL("FileName",A1),FIND("]",CELL("FileName",A1))-1),"[","")



==============

And if you want to play around:

FILENAME: =MID(CELL("FILENAME",A1),FIND("[",CELL("FILENAME",A1))+1,FIND("]",CELL("FILENAME",A1))-FIND("[",CELL("FILENAME",A1))-5)

SHEETNAME: =RIGHT(CELL("FILENAME",A1),LEN(CELL("FILENAME",A1) )-FIND("]",CELL("FILENAME",A1)))
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums

Last edited by shades; 01-05-05 at 16:40.
Reply With Quote
  #5 (permalink)  
Old 01-05-05, 16:38
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
If you have the Excel add-in (free!) called Morefunc.xll, you can do this more easily. And it has many other useful functions that Excel does not:

morefunc
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #6 (permalink)  
Old 01-06-05, 11:15
surfacesys surfacesys is offline
Registered User
 
Join Date: Mar 2004
Location: Greenville, SC
Posts: 271
Thank You very, very much shades (=substitute) is exactly what I needed.

Michael
__________________
Gotta to do some code
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On