Hi,
I'm confused. I can't get XL to programatically set the print on a sheet to the mulitple ranges that I have as a print area on another sheet!
Now normally I'd use
...but that isn't working.
If I capture the multiple range by recording the print setup on then other sheet - like below:
...then one would think that would work. But nooo.
The reason I need this is to transfer the pretty complex report print structure to text-copies of the file.
Any ideas?
(Thread originally posted in Office forum)
// Patrik
______________________________
To the optimist, the glass is half full. To the pessimist, the glass is half empty. To the IT Professional, the glass is twice as big as it needs to be.
I'm confused. I can't get XL to programatically set the print on a sheet to the mulitple ranges that I have as a print area on another sheet!
Now normally I'd use
Code:
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$5"
.PrintTitleColumns = "$A:$F"
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
ActiveSheet.PageSetup.PrintArea = "$G$7:$L$50;$G$52:$L$103;$N$7:$S$50;$N$52:$S$103;$U$7:$Z$50;$U$52:$Z$103;$AB$7:$AG$50;$AB$52:$AG$103;$AI$7:$AN$50;$AI$52:$AN$103"
...but that isn't working.
If I capture the multiple range by recording the print setup on then other sheet - like below:
Code:
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$5"
.PrintTitleColumns = "$A:$F"
End With
ActiveSheet.PageSetup.PrintArea = "$G$7:$L$50;$G$52:$L$103;$N$7:$S$50;$N$52:$S$103;$U$7:$Z$50;$U$52:$Z$103;$AB$7:$AG$50;$AB$52:$AG$103;$AI$7:$AN$50;$AI$52:$AN$103"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.78740157480315)
.RightMargin = Application.InchesToPoints(0.78740157480315)
.TopMargin = Application.InchesToPoints(0.984251968503937)
.BottomMargin = Application.InchesToPoints(0.984251968503937)
.HeaderMargin = Application.InchesToPoints(0.511811023622047)
.FooterMargin = Application.InchesToPoints(0.511811023622047)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
.PrintErrors = xlPrintErrorsDisplayed
End With
...then one would think that would work. But nooo.
The reason I need this is to transfer the pretty complex report print structure to text-copies of the file.
Any ideas?
(Thread originally posted in Office forum)
// Patrik
______________________________
To the optimist, the glass is half full. To the pessimist, the glass is half empty. To the IT Professional, the glass is twice as big as it needs to be.