#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 111
Default macro for footer

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic update of footer macro Greg Excel Worksheet Functions 2 October 19th 07 01:22 AM
Add Font to Header/Footer macro JHL Excel Discussion (Misc queries) 4 January 5th 07 07:45 PM
Footer Macro Erika Excel Discussion (Misc queries) 3 December 6th 05 08:47 PM
Header and Footer Macro dhuang via OfficeKB.com Excel Discussion (Misc queries) 1 October 31st 05 04:14 PM
Footer Macro? mully Excel Discussion (Misc queries) 0 September 10th 05 10:37 AM


All times are GMT +1. The time now is 06:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"