ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   FitToPagesWide (https://www.excelbanter.com/excel-programming/355556-fittopageswide.html)

Jérémie Gent

FitToPagesWide
 
Hi! I'vo got an Excel sheet that I'd like to print 'properly' from vba code.
It must be 1 A4 wide (portrait) and contains many manual PageBreaks.
Here is my idea: I first set the PageSetup that way
PageSetup.zoom=false
PageSetup.FitToPagesWide=1
PageSetup.FitToPagesWide=50
(for example), so a zoom factor is calculated for the width to be correct
and the sheet fits to 1 page wide.
Unfortunately, I can't print that way, because in this mode, the manual
PageBreaks are ignored, so I have to set it back to zoom mode, so I'd like
to switch back to
PageSetup.zoom = x
where x would be the previously calculated zoom factor (in the FitToPage
mode), for example 70%

My problem is that I don't know where to read the value of the calculated
zoom factor (x)
Could someone help me ? (PageSetup.zoom stays to false, not to 70)
Maybe I could also calculate it myself ?

Thanks a lot!




Dave Peterson

FitToPagesWide
 
You have a response in .excel.

"Jérémie Gent" wrote:

Hi! I'vo got an Excel sheet that I'd like to print 'properly' from vba code.
It must be 1 A4 wide (portrait) and contains many manual PageBreaks.
Here is my idea: I first set the PageSetup that way
PageSetup.zoom=false
PageSetup.FitToPagesWide=1
PageSetup.FitToPagesWide=50
(for example), so a zoom factor is calculated for the width to be correct
and the sheet fits to 1 page wide.
Unfortunately, I can't print that way, because in this mode, the manual
PageBreaks are ignored, so I have to set it back to zoom mode, so I'd like
to switch back to
PageSetup.zoom = x
where x would be the previously calculated zoom factor (in the FitToPage
mode), for example 70%

My problem is that I don't know where to read the value of the calculated
zoom factor (x)
Could someone help me ? (PageSetup.zoom stays to false, not to 70)
Maybe I could also calculate it myself ?

Thanks a lot!


--

Dave Peterson


All times are GMT +1. The time now is 11:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com