ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Set View to 75% upon Workbook open (https://www.excelbanter.com/excel-worksheet-functions/60548-set-view-75%25-upon-workbook-open.html)

John

Set View to 75% upon Workbook open
 
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



Bob Phillips

Set View to 75% upon Workbook open
 
Try adding this to the end of the code

activewindow.Zoom=75%

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"John" wrote in message
...
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





Harlan Grove

Set View to 75% upon Workbook open
 
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?


John

Set View to 75% upon Workbook open
 
Thanks Bob

"Bob Phillips" wrote in message
...
Try adding this to the end of the code

activewindow.Zoom=75%

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"John" wrote in message
...
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







John

Set View to 75% upon Workbook open
 
How could I prevent the change of the Zoom property Harlan?


"Harlan Grove" wrote in message
ps.com...
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?




Harlan Grove

Set View to 75% upon Workbook open
 
"John" wrote...
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.




All times are GMT +1. The time now is 06:41 AM.

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