Animalised
New Member
- Joined
- Apr 24, 2016
- Messages
- 31
Hi Everyone,
I'm trying to create a default "Print Setup" that will apply to all the tabs i have in my document. I continue to only be able to create a page setup for the first tab (First tab is "Summary").
This is my code, it doesnt do what im looking for. The code i had only changes the settings for the first tab.
Any help would be very appreciated!
Thank you again!
I'm trying to create a default "Print Setup" that will apply to all the tabs i have in my document. I continue to only be able to create a page setup for the first tab (First tab is "Summary").
This is my code, it doesnt do what im looking for. The code i had only changes the settings for the first tab.
Code:
Private Sub CommandButton21_Click()
Dim ws As Worksheet
For Each ws In Sheets
If ws.Visible Then ws.Select (False)
Next
Dim MyPrintArea As Range
Set MyPrintArea = ActiveSheet.Range("A1:G15")
Application.PrintCommunication = True
With ActiveSheet.PageSetup
.PrintArea = MyPrintArea
.LeftHeader = ""
.CenterHeader = "&F"
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = "&A"
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.236220472440945)
.RightMargin = Application.InchesToPoints(0.236220472440945)
.TopMargin = Application.InchesToPoints(0.748031496062992)
.BottomMargin = Application.InchesToPoints(0.748031496062992)
.HeaderMargin = Application.InchesToPoints(0.31496062992126)
.FooterMargin = Application.InchesToPoints(0.31496062992126)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = True
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = True
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
ThisWorkbook.PrintOut
End Sub
Any help would be very appreciated!
Thank you again!