Header & Footer to all files in a folder!

G

Guest

Hi, I have so many files in a folder, what I want is to insert a common
header and footer to all these files. Is this possibe, so that i dont have to
open each file and do the same agian & again. Thanks. Amit.
 
G

Guest

hi,
you could record a macro and put it in your personal file in the xlstart
folder then assign the macro to a toolbar icon. this way setting the headers
would be just a button click. i recorded this macro. tool about a minute.
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 6/22/2007 by user

With ActiveSheet.PageSetup
.LeftHeader = "left"
.CenterHeader = "title"
.RightHeader = "date"
.LeftFooter = "left"
.CenterFooter = "bottom"
.RightFooter = "page1"
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
End With
ActiveWindow.SelectedSheets.PrintPreview
End Sub

regards
FSt1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top