ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Path in page footer (https://www.excelbanter.com/excel-discussion-misc-queries/42066-path-page-footer.html)

Joshua K Briley

Path in page footer
 
How can I include the full path of where the document resides on my
workstation, in the footer of my worksheets?
--
Somecallmejosh

Bob Phillips

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wsSht As Worksheet
For Each wsSht In ActiveWindow.SelectedSheets
wsSht.PageSetup.LeftFooter = "&""Arial,Bold""&8" & Me.FullName
Next wsSht
End Sub


'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Joshua K Briley" wrote in message
...
How can I include the full path of where the document resides on my
workstation, in the footer of my worksheets?
--
Somecallmejosh




Joshua K Briley

Thanks Bob,

I've found similar code from Microsoft, but I'm looking to do it from a
global perspective, if it is at all doable. Sorry for leaving out that
little detail. Can it be done?

There is a toolbar in word that allows for this, but I can't seem to locate
anything outside of code that will allow me to do it in Excel.
--
Somecallmejosh


"Bob Phillips" wrote:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wsSht As Worksheet
For Each wsSht In ActiveWindow.SelectedSheets
wsSht.PageSetup.LeftFooter = "&""Arial,Bold""&8" & Me.FullName
Next wsSht
End Sub


'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Joshua K Briley" wrote in message
...
How can I include the full path of where the document resides on my
workstation, in the footer of my worksheets?
--
Somecallmejosh





Bob Phillips

Josh,

You could try this. Add this code to Personal.xls, and it will then
automatically set the footer for any sheet in any workbook.

Private WithEvents app As Application

Private Sub app_WorkbookBeforePrint(ByVal Wb As Workbook, Cancel As Boolean)
With Wb.ActiveSheet
.PageSetup.LeftFooter = "&""Arial,Bold""&8" & Wb.FullName
End With
End Sub

Private Sub Workbook_Open()
Set app = Application
End Sub


'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Joshua K Briley" wrote in message
...
Thanks Bob,

I've found similar code from Microsoft, but I'm looking to do it from a
global perspective, if it is at all doable. Sorry for leaving out that
little detail. Can it be done?

There is a toolbar in word that allows for this, but I can't seem to

locate
anything outside of code that will allow me to do it in Excel.
--
Somecallmejosh


"Bob Phillips" wrote:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wsSht As Worksheet
For Each wsSht In ActiveWindow.SelectedSheets
wsSht.PageSetup.LeftFooter = "&""Arial,Bold""&8" & Me.FullName
Next wsSht
End Sub


'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Joshua K Briley" wrote in

message
...
How can I include the full path of where the document resides on my
workstation, in the footer of my worksheets?
--
Somecallmejosh







Joshua K Briley

Thanks again Bob,

I've added the code to a workbook I've entitled as personal.xls. Is there a
specific location where this file should be saved for it to affect all other
workbooks? Or should it be saved as a template, from which to create new
workbooks?

I'm not sure that I did things correctly, because the code did not work on
the file itself. When I type in the following code, I get the desired
results... one page at a time:

Sub UpdateFooter()
ActiveSheet.PageSetup.LeftFooter = ActiveWorkbook.FullName
End Sub
--
Somecallmejosh


"Bob Phillips" wrote:

Josh,

You could try this. Add this code to Personal.xls, and it will then
automatically set the footer for any sheet in any workbook.

Private WithEvents app As Application

Private Sub app_WorkbookBeforePrint(ByVal Wb As Workbook, Cancel As Boolean)
With Wb.ActiveSheet
.PageSetup.LeftFooter = "&""Arial,Bold""&8" & Wb.FullName
End With
End Sub

Private Sub Workbook_Open()
Set app = Application
End Sub


'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Joshua K Briley" wrote in message
...
Thanks Bob,

I've found similar code from Microsoft, but I'm looking to do it from a
global perspective, if it is at all doable. Sorry for leaving out that
little detail. Can it be done?

There is a toolbar in word that allows for this, but I can't seem to

locate
anything outside of code that will allow me to do it in Excel.
--
Somecallmejosh


"Bob Phillips" wrote:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wsSht As Worksheet
For Each wsSht In ActiveWindow.SelectedSheets
wsSht.PageSetup.LeftFooter = "&""Arial,Bold""&8" & Me.FullName
Next wsSht
End Sub


'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Joshua K Briley" wrote in

message
...
How can I include the full path of where the document resides on my
workstation, in the footer of my worksheets?
--
Somecallmejosh







Bob Phillips

Joshua,

The hint is at the foot of the message. You need to store it in ThisWorbook,
see the directions. It also needs to be initialised, so close down Excel,
and start anew. The Workbook_Open should kick it off.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Joshua K Briley" wrote in message
...
Thanks again Bob,

I've added the code to a workbook I've entitled as personal.xls. Is there

a
specific location where this file should be saved for it to affect all

other
workbooks? Or should it be saved as a template, from which to create new
workbooks?

I'm not sure that I did things correctly, because the code did not work on
the file itself. When I type in the following code, I get the desired
results... one page at a time:

Sub UpdateFooter()
ActiveSheet.PageSetup.LeftFooter = ActiveWorkbook.FullName
End Sub
--
Somecallmejosh


"Bob Phillips" wrote:

Josh,

You could try this. Add this code to Personal.xls, and it will then
automatically set the footer for any sheet in any workbook.

Private WithEvents app As Application

Private Sub app_WorkbookBeforePrint(ByVal Wb As Workbook, Cancel As

Boolean)
With Wb.ActiveSheet
.PageSetup.LeftFooter = "&""Arial,Bold""&8" & Wb.FullName
End With
End Sub

Private Sub Workbook_Open()
Set app = Application
End Sub


'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Joshua K Briley" wrote in

message
...
Thanks Bob,

I've found similar code from Microsoft, but I'm looking to do it from

a
global perspective, if it is at all doable. Sorry for leaving out

that
little detail. Can it be done?

There is a toolbar in word that allows for this, but I can't seem to

locate
anything outside of code that will allow me to do it in Excel.
--
Somecallmejosh


"Bob Phillips" wrote:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wsSht As Worksheet
For Each wsSht In ActiveWindow.SelectedSheets
wsSht.PageSetup.LeftFooter = "&""Arial,Bold""&8" &

Me.FullName
Next wsSht
End Sub


'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Joshua K Briley" wrote in

message
...
How can I include the full path of where the document resides on

my
workstation, in the footer of my worksheets?
--
Somecallmejosh









Dave Peterson

John Walkenbach has an addin you may like.
http://j-walk.com/ss/excel/files/addpath.htm

It builds the macro code for you if you run the macro. (You may not always want
to do this???).

You can save John's addin anywhere, then turn it on via Tools|Addins (and point
to the location where you saved the addin).

Alternatively, if you're running xl2002+ (which supports the full path in
headers/footers), you could use a couple of template files.

Create a new workbook named book.xlt and set up the page layout the way you
want.

Save this book.xlt in your XLStart folder.

You can create another single sheet workbook that has the same page layout, but
save it as sheet.xlt.

Any new workbook will inherit the settings from book.xlt. Any new worksheet
added to an existing workbook will inherit the settings from sheet.xlt.

But this won't help any existing worksheets in existing workbooks.



Joshua K Briley wrote:

How can I include the full path of where the document resides on my
workstation, in the footer of my worksheets?
--
Somecallmejosh


--

Dave Peterson


All times are GMT +1. The time now is 03:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com