macro to zoom all sheets to full screen size

skf786

Board Regular
Joined
Sep 26, 2010
Messages
156
hi,

i am using the following script on 'this workbook' so when the file opens, the first sheet is full screen and stretched from a1 to U1 (this is the DefinedRange). i would like all sheets to be stretched from A1 to U1. what would b the code for this.

thank you

VBA Code:
Private Sub Workbook_Open()
 Application.DisplayFullScreen = True

Range("DefinedRange").Select
ActiveWindow.Zoom = True
'Cells(1, 1).Select


End Sub
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
How about
VBA Code:
   Dim Ws As Worksheet
   Application.ScreenUpdating = False
   
   For Each Ws In Worksheets
      Ws.Activate
      Ws.Range("A1:U1").Select
      ActiveWindow.Zoom = True
      Ws.Range("A1").Select
   Next Ws
 
Upvote 0
How about
VBA Code:
   Dim Ws As Worksheet
   Application.ScreenUpdating = False
  
   For Each Ws In Worksheets
      Ws.Activate
      Ws.Range("A1:U1").Select
      ActiveWindow.Zoom = True
      Ws.Range("A1").Select
   Next Ws
thanks this works well. i would like to end up on cell A1 on 'Home' sheet. thats the name of the sheet.

thanks again
 
Upvote 0
Just put a line of code at the end to select that sheet.
 
Upvote 0
Add this after the loop
VBA Code:
Sheets("Home").Select
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top