View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Woody[_4_] Woody[_4_] is offline
external usenet poster
 
Posts: 1
Default BeforePrint Event

HI,

I am trying to develop some VBA code in excel 2003 that will
automatically place a specific header and footer on any sheet I print
from excel.

So far I have created the following code in my personal workbook.

Public Sub App_WorkbookBeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = "&D &T"
ActiveSheet.PageSetup.CenterFooter = "&F"
End Sub

It appears to work for that workbook but not others I have open.

Can anyone suggest how I can make this code apply to the excel
application instead of to a particular workbook?

Thanks,