Hello Everyone,
I'm working on a code that could set multiple printarea and use the defined print area to print on different pages.
Reading the 6 pages of topics on Printarea, I did not find anything that solve my problem.
Here is what I want to do :
I have a worksheet with lots of columns. I would like to define 3 printarea using the following ranges : (A1:P33), (Q1:AE33) and (AF1:AT33)
When I go in the print preview I'd like to have range1 on page 1, range2 on page 2 and range3 on page 3.
Is this even possible for excel to remember the printarea and set it in different pages?
I wrote the code below but it gives me only one page with the 3 ranges on it.
Some help would be greatly appreciated
Thank you in advance
Dracken
I'm working on a code that could set multiple printarea and use the defined print area to print on different pages.
Reading the 6 pages of topics on Printarea, I did not find anything that solve my problem.
Here is what I want to do :
I have a worksheet with lots of columns. I would like to define 3 printarea using the following ranges : (A1:P33), (Q1:AE33) and (AF1:AT33)
When I go in the print preview I'd like to have range1 on page 1, range2 on page 2 and range3 on page 3.
Is this even possible for excel to remember the printarea and set it in different pages?
I wrote the code below but it gives me only one page with the 3 ranges on it.
Code:
Sheets("TableauFormate").Select
Let rngProjet1 = "$A$1" & ":" & "$P$33"
Let rngProjet2 = "$Q$1" & ":" & "$AE$33"
Let rngProjet3 = "$AF$1" & ":" & "$AT$33"
With ActiveSheet
ActiveSheet.PageSetup.PrintArea = rngProjet1 '& "," & rngProjet2 & "," & rngProjet3
End With
With ActiveSheet.PageSetup
.CenterHorizontally = True
.CenterVertically = True
.Orientation = xlLandscape
.LeftMargin = Application.InchesToPoints(0)
.RightMargin = Application.InchesToPoints(0)
.TopMargin = Application.InchesToPoints(0)
.BottomMargin = Application.InchesToPoints(0)
.HeaderMargin = Application.InchesToPoints(0)
.FooterMargin = Application.InchesToPoints(0)
.PrintQuality = 600
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
Some help would be greatly appreciated
Thank you in advance
Dracken