The_Steward
Board Regular
- Joined
- Nov 26, 2020
- Messages
- 63
- Office Version
- 365
- Platform
- Windows
Hey!
Trying to run a script in ThisWorkbook Object that auto zooms to the range selection when a new sheet is selected. I often use two screens and want any sheet I use to automatically zoom into the selection when I switch to it regardless of what screen size i'm using.
This is what I have so far. It currently just resizes the active sheet after I run the macro.
Trying to run a script in ThisWorkbook Object that auto zooms to the range selection when a new sheet is selected. I often use two screens and want any sheet I use to automatically zoom into the selection when I switch to it regardless of what screen size i'm using.
This is what I have so far. It currently just resizes the active sheet after I run the macro.
VBA Code:
Sub Worksheet_Zoom()
Dim ws As Worksheet
For Each ws In ThisWorkbook.workSheets
Range("B1:AD26").Select
ActiveWindow.Zoom = True
Range("A1").Select
Next ws
End Sub