Hello all,
With the following code a area can be selected and then a preview of it will be shown. However is there a way to select multiple area's that will then be print out on the same piece of paper.
Something like: A2:X14 and A100:X125
However this is just an example. The range is variable
So in short: I want the user to select 2 ranges and let the code bundle them ¨with perhaps 1 empty row in between.
If this is possible off-course?
Sub PrintArea()
Application.ScreenUpdating = False
Dim myRange As String
myRange = Selection.Address
ActiveSheet.PageSetup.PrintArea = myRange
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.2)
.RightMargin = Application.InchesToPoints(0.2)
.TopMargin = Application.InchesToPoints(0.2)
.BottomMargin = Application.InchesToPoints(0.2)
.HeaderMargin = Application.InchesToPoints(0.2)
.FooterMargin = Application.InchesToPoints(0.2)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 2
.PrintErrors = xlPrintErrorsDisplayed
End With
Application.EnableEvents = False
ActiveWindow.SelectedSheets.PrintPreview
Application.EnableEvents = True
End Sub
Bookmarks