Set View to 75% upon Workbook open

J

John

I have the following code which runs upon opening my workbook. How would I
include to View of this "Current Week" to 75% upon open also? I have a user
that changes it to 100% each time they use it

Thanks



Private Sub Workbook_Open()
Application.ScreenUpdating = False
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
sh.Select
Application.Goto Reference:=sh.Range("a1"), Scroll:=True
Next sh
ThisWorkbook.Sheets("Current Week").Select
Application.ScreenUpdating = True
Range("C6").Select

End Sub
 
B

Bob Phillips

Try adding this to the end of the code

activewindow.Zoom=75%

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
H

Harlan Grove

John wrote...
I have the following code which runs upon opening my workbook. How would I
include to View of this "Current Week" to 75% upon open also? I have a user
that changes it to 100% each time they use it
....

The macro recorder is your friend.

ActiveWindow.Zoom = 75

That said, is your goal to prevent this user from saving the workbook
with this particular worksheet's Zoom property set to 100 or to force
the user to view this worksheet at 75 zoom?
 
J

John

Thanks Bob

Bob Phillips said:
Try adding this to the end of the code

activewindow.Zoom=75%

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
H

Harlan Grove

John said:
How could I prevent the change of the Zoom property Harlan?
....

Mine was a rhetorical question. Can't be done. While it may be possible to
disable or remove the Zoom entry from the View menu, there are other ways to
change the zoom setting. You could use the WorksheetSelectionChange event
handler to reset the zoom to 75, but that'd only be annoying. Just let your
users change the zoom setting as long as you have macros that'll reset it
every time anyone opens the workbook.
 

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