View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Adding file name and path to to footer of all workbooks in a folder.

Hi
for one file: put the following code in your workbook module (not in a
standard
module):

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In Me.Worksheets
With wkSht.PageSetup
.CenterFooter = Me.FullName
End With
Next wkSht
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany


Muxer wrote:
Hello,

Can anyone show me some examples of how to add the file name and path
of workbook to the footer. I would like to do this to all *.xls files
in a folder.

Since at times there is going to be hundreds of files, is it fastest
and/or easier to do this via an add-in, macro or from VB6?

Regards,
LRR