Sub Path_All_Sheets()
Dim ws as WorkSheet
Set wkbktodo = ActiveWorkbook
For Each ws In wkbktodo.Worksheets
ws.PageSetup.LeftFooter = ActiveWorkbook.FullName
Next
End Sub
Copy/paste to a general module and run using a button, shortcut key combo or
just from ToolsMacroMacros.
Alternative......copy/paste to the ThisWorkbook module
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim ws as WorkSheet
Set wkbktodo = ActiveWorkbook
For Each ws In wkbktodo.Worksheets
ws.PageSetup.LeftFooter = ActiveWorkbook.FullName
Next
End Sub
Gord Dibben Excel MVP
On Thu, 2 Dec 2004 14:21:03 -0800, "PCE Man" <PCE
wrote:
Using VBA, how can I add the filename to the left foote, before printing, in
all worksheets of the open workbook, without manually opening up each
worksheet and adding a custom footer.