ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA to prohibit changes to scale setting in page-setup (https://www.excelbanter.com/excel-programming/292309-re-vba-prohibit-changes-scale-setting-page-setup.html)

JE McGimpsey

VBA to prohibit changes to scale setting in page-setup
 
No, but you could use the Before_Print() event macro to reset the zoom
before printing.

Put something like this in your ThisWorkbook code module:


Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wsSheet As Worksheet
For Each wsSheet In ActiveWindow.SelectedSheets
With wsSheet.PageSetup
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
End Sub



In article ,
Phil Hageman wrote:

I am using an auto-open and auto-close sub for a workbook with numberous
worksheets. The worksheets use different settings for scaling in page-setup
which guarantees full-page printing. Problem is, some users modify this
setting, which distorts printed copy. Is there code I could add in the
auto-open to disallow modifications to scale settings, and then to restore
the capability upon close?

Thanks,
Phil


Phil Hageman[_3_]

VBA to prohibit changes to scale setting in page-setup
 
Thanks for your reply - this works. I need to modify it though, to accomodate different scale settings for different worksheets. For example
Worksheet "Scorecard" scale is 95
Worksheet "Financial" scale is 90
Worksheet "Customer" scale is 90
Etc

Can you help me with this

Phil

Phil Hageman[_3_]

VBA to prohibit changes to scale setting in page-setup
 
Another issue comes to light: The worksheets have different print areas
Worksheet "Scorecard" has one range - B1:BA4
Worksheet "Financial" has three ranges - B1:BA32, B33:BA64, B65:BA9
Worksheet "Customer" has three ranges - B1:BA32, B33:BA64, B65:BA9



All times are GMT +1. The time now is 02:44 PM.

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