close

I would like to set up a default where all Excel documents automatically show
the file name when printed. Thanks!

Add this code to the ThisWorbook code module

Dim WithEvents AppClass As Application

Private Sub Appclass_WorkbookBeforePrint(ByVal Wb As Workbook, Cancel As
Boolean)
With Wb.ActiveSheet.PageSetup
.LeftFooter = Wb.FullName
End With
End Sub

Private Sub Workbook_Open()

Set AppClass = Application

End Sub--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

quot;Mrs. Squot; lt;Mrs. gt; wrote in message
...
gt; I would like to set up a default where all Excel documents automatically
show
gt; the file name when printed. Thanks!
In article gt;, =?Utf-8?B?TXJzLiBT?= lt;Mrs. gt; wrote:
gt;I would like to set up a default where all Excel documents automatically show
gt;the file name when printed. Thanks!

You could try putting this formula in a cell (I use it at the top of the
sheet) and save it as your template (book.xls ? - depends on your version)
...

=CELL(quot;filenamequot;,A1)

A1 can be any cell. The CELL function can provide other useful info too.

I usually add the date (=today()) but that means it will update every time
you open it (and you'll get a quot;save changesquot; mesage if you close it, even if
you haven't made any ).

HTHBruce

----------------------------------------
I believe you find life such a problem because you think there are the good
people and the bad people. You're wrong, of course. There are, always and
only, the bad people, but some of them are on opposite sides.

Lord Vetinari in Guards ! Guards ! - Terry Pratchett

Caution ===== followups may have been changed to relevant groups
(if there were any)

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()