title: VBA to set Zoom level on Sheets
body: <p>I have a VBA that will set the zoom level based on the screen resolution.
  But its working only for ActiveWindow when you open workbook.
  How can I add this across all worksheets in Excel?</p>
  
  <pre><code>Declare Function GetSystemMetrics32 Lib "user32" _
      Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long
  
  Public Sub ScreenRes()
      Dim lResWidth As Long
      Dim lResHeight As Long
      Dim sRes As String
  
      lResWidth = GetSystemMetrics32(0)
      lResHeight = GetSystemMetrics32(1)
      sRes = lResWidth &amp; "x" &amp; lResHeight
      Select Case sRes
          Case Is = "800x600"
              ActiveWindow.Zoom = 75
          Case Is = "1024x768"
              ActiveWindow.Zoom = 125
          Case Else
              ActiveWindow.Zoom = 100
      End Select
  End Sub
  </code></pre>
  
  <p>I will call this module on the Workbook</p>
  
  <pre><code>Private Sub Workbook_Open()
  ScreenRes
  End Sub
  </code></pre>