Questa sub copia il formato pagina da un worksheet (wsFr) ad un altro
(wsTo):
Puoi fare un ciclo nel quale la chiami per ogni foglio del workbook.
'----------------------
'in un modulo standard:
'
Public Sub setpage(ByVal wsFr As Worksheet, ByVal wsTo As Worksheet)
'by Scossa
Dim xCalc As XlCalculation
Dim bScreen As Boolean
Dim PgSetFr As PageSetup
Dim PgSetTo As PageSetup
With Application
xCalc = .Calculation
bScreen = .ScreenUpdating
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
Set PgSetFr = wsFr.PageSetup
Set PgSetTo = wsTo.PageSetup
With PgSetTo
.BottomMargin = PgSetFr.BottomMargin
.CenterFooter = PgSetFr.CenterFooter
'.CenterFooterPicture = PgSetFr.CenterFooterPicture
.CenterHeader = PgSetFr.CenterHeader
'.CenterHeaderPicture = PgSetFr.CenterHeaderPicture
.CenterHorizontally = PgSetFr.CenterHorizontally
.CenterVertically = PgSetFr.CenterVertically
.FirstPageNumber = PgSetFr.FirstPageNumber
.Zoom = PgSetFr.Zoom
.FitToPagesTall = PgSetFr.FitToPagesTall
.FitToPagesWide = PgSetFr.FitToPagesWide
.FooterMargin = PgSetFr.FooterMargin
.HeaderMargin = PgSetFr.HeaderMargin
.LeftFooter = PgSetFr.LeftFooter
'.LeftFooterPicture = PgSetFr.LeftFooterPicture
.LeftHeader = PgSetFr.LeftHeader
'.LeftHeaderPicture = PgSetFr.LeftHeaderPicture
.LeftMargin = .LeftMargin
.Order = PgSetFr.Order
.Orientation = PgSetFr.Orientation
.PaperSize = PgSetFr.PaperSize
.PrintArea = .PrintArea
.PrintComments = PgSetFr.PrintComments
.PrintGridlines = PgSetFr.PrintGridlines
.PrintHeadings = PgSetFr.PrintHeadings
.PrintQuality = PgSetFr.PrintQuality
.PrintTitleColumns = PgSetFr.PrintTitleColumns
.PrintTitleRows = PgSetFr.PrintTitleRows
.RightFooter = PgSetFr.RightFooter
'.RightFooterPicture = PgSetFr.RightFooterPicture
.RightHeader = PgSetFr.RightHeader
'.RightHeaderPicture = PgSetFr.RightHeaderPicture
.RightMargin = PgSetFr.RightMargin
.TopMargin = PgSetFr.TopMargin
End With
Set wsTo = Nothing
Set wsFr = Nothing
Set PgSetFr = Nothing
Set PgSetTo = Nothing
With Application
.Calculation = xCalc
.ScreenUpdating = bScreen
End With
End Sub
'------------------------
Bye!
Scossa