View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default macro for footer

This code should do what you need. Right click the XL icon in the upper left
hand corner of the XL window and select View code. This will take you to the
VBE. Paste the following...

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wks As Worksheet

For Each wks In ActiveWindow.SelectedSheets
With wks.PageSetup
.LeftFooter = ThisWorkbook.Path & "\" & ThisWorkbook.Name
.RightFooter = Date
End With
Next wks
End Sub
--
HTH...

Jim Thomlinson


"april" wrote:

on each excel document that i print, i would like to include the date, the
file name, and the path. i saw a solution to this but the solution pertained
only to new documents. how do i set up a macro in an existing document that
automatically prints that info?

thanks for your help
--
aprilshowers