Setting zoom of 2 sheets equal

J

jbl25

Hello,
I'm trying to set the zoom value of one sheet ("Sheet2") in a workbook
equal to the zoom value of another sheet ("Sheet1") each time Sheet1 is
activated. I've tried the code below, but z is equal to 60 when
Sheet1's zoom is 80%, and it doesn't change Sheet2's zoom value. What
am I doing wrong? Thanks!

Dim z As Integer
z = Worksheets("Sheet1").PageSetup.Zoom
Worksheets("Sheet2").PageSetup.Zoom = z
 
T

Tom Ogilvy

Pagesetup is for printing

worksheets("Sheet1").Activate
z = Activewindow.Zoom
Worksheets("Sheet2").Activate
ActiveWindow.Zoom = z
 
B

Bernie Deitrick

Do you actually want to change the print zoom, or the view zoom? To change the view zoom:

Dim z As Integer
Worksheets("Sheet1").Activate
z = ActiveWindow.Zoom
Worksheets("Sheet2").Activate
ActiveWindow.Zoom = z

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top