Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like to put the code below somewhere so that it will be activated
every time a worksheet is viewed or printed. I have tried putting it in a module in my Private.xls workbook but since I don't call it in a procedure, it doesn't work like I want. The only way it works is if I put it into the code behind each of the workbooks in use. I have a particular need to have our bookkeeper the put the path name on all the worksheets except in those instances where it is sent as a pdf or xls file for inclusion in other documents. In those instances the footer needs to be consciously removed. If I can cajole Excel to use this code, it will keep our church administrator much happier. Regards, Ernie Lippert ------------------------------------------------------ Option Explicit Sub Workbook_BeforePrint(Cancel As Boolean) Call ErnieAddPath End Sub Sub ErnieAddPath() Dim Ans As XlYesNoGuess Ans = MsgBox("Add path to footer?", vbYesNo + vbQuestion, "Tell Me") If Ans = vbNo Then ActiveSheet.PageSetup.LeftFooter = "" Else: ActiveSheet.PageSetup.LeftFooter = "&8" & LCase(ThisWorkbook.FullName) End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I make several workbooks work together? | New Users to Excel | |||
make severaly workbooks 1 | Excel Programming | |||
make severaly workbooks 1 | Excel Programming | |||
How to make a macro available to all the workbooks? | Excel Programming | |||
Make Macro available to all new workbooks | Excel Programming |