ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Header & Footer to all files in a folder! (https://www.excelbanter.com/excel-discussion-misc-queries/147584-header-footer-all-files-folder.html)

Amit Kumar Baidyaka

Header & Footer to all files in a folder!
 
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.

FSt1

Header & Footer to all files in a folder!
 
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

"Amit Kumar Baidyaka" wrote:

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.



All times are GMT +1. The time now is 11:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com