RE: macro for footer

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
.



Relevant Pages

  • RE: Marquee Each Line From a Text File In a "Chromeless" IE!
    ... I understand that it appears that you allowed room in the upper right hand ... hand corner, but I am trying to figure out the code. ... What I would like to do is have a "chromeless" IE browser window pop up at ... Button = WshShell.Popup(sAllTogether, DelaySecs, sAllTogether, 1) ...
    (microsoft.public.scripting.jscript)
  • Re: Failsafe mode
    ... >> with a terminal command line in the upper right hand corner. ... Does it look like a small terminal window in the upper right hand ... > This tells me you might already be in runlevel 5 and have gotten an ... X server works as does your display manager and window manager. ...
    (alt.os.linux.suse)
  • Re: Closing Internet Explorer with double-click on icon in left-hand corner
    ... > I am unable to close the window with a double click on ... > the icon in the upper left hand corner. ...
    (microsoft.public.windowsxp.basics)
  • Re: Closing Internet Explorer with double-click on icon in left-hand corner
    ... > I am unable to close the window with a double click on ... > the icon in the upper left hand corner. ...
    (microsoft.public.windowsxp.basics)
  • Re: Road Runner Icon
    ... The following instructions by MVP Kelly shows us how to change the logo (throbber) on the upper ... The little one at the upper right hand corner of the ... > program changed the icon from the windows flag to road runner icon. ...
    (microsoft.public.windowsxp.customize)