I have some code in my VBA that I recorded.
It fits my worksheet on 1 page, landscape.
when the VBA runs, it does this part of it, but keeps the print preview screen open - meaning that I have to manually press 'close' for it to carry on with the rest of the VBA code.
does anyone know why this is?
my code is here:
It fits my worksheet on 1 page, landscape.
when the VBA runs, it does this part of it, but keeps the print preview screen open - meaning that I have to manually press 'close' for it to carry on with the rest of the VBA code.
does anyone know why this is?
my code is here:
Code:
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.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 = xlLandscape
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
ActiveWindow.SelectedSheets.printpreview
Columns("D:P").Select
Selection.ColumnWidth = 13.5
ActiveWindow.SelectedSheets.printpreview