Hi
In Excel, setting the zoom control only applies to the worksheet you're working on and not the whole workbook. I created a "zoom all" macro so that all worksheets would show the same size.
In the macro, it runs through all visible sheets but how can I get it to bring focus back to the sheet it started on? For example, if I invoke it on sheet 6 I want it to run and come back to sheet 6 when it ends. Thanks very much.
In Excel, setting the zoom control only applies to the worksheet you're working on and not the whole workbook. I created a "zoom all" macro so that all worksheets would show the same size.
In the macro, it runs through all visible sheets but how can I get it to bring focus back to the sheet it started on? For example, if I invoke it on sheet 6 I want it to run and come back to sheet 6 when it ends. Thanks very much.
Code:
Sub zoom_choice()
Dim response
Dim canceltest As Variant
Dim x As Integer
Dim ws As Worksheet
Application.ScreenUpdating = False
response = InputBox("Enter the zoom magnification you would like")
If StrPtr(response) = 0 Then
MsgBox "Cancelled", vbOKOnly, "Cancel Zoom"
Else
For Each ws In Worksheets
If ws.Visible Then ws.Activate
ActiveWindow.zoom = response
Next
Application.ScreenUpdating = True
End If
End Sub