Step 1 – Open the VBA Window
- Press ALT+F11 to open the VBA window.
- Select Insert >> Module.
Step 2 – Create the Sub Procedure
Sub LockZoomInExcel()
End Sub
Step 3 – Add a Do Loop to Lock the Zoom
Sub LockZoomInExcel()
Do
Loop While True
End Sub
Step 4 – Add an IF Statement to Reset the Zoom
Sub LockZoomInExcel()
Do
If ActiveWindow.Zoom <> 100 Then
ActiveWindow.Zoom = 100
End If
Loop While True
End Sub
Step 5 – Include a DoEvents Statement
(Here you get the complete code)
Sub LockZoomInExcel()
Do
If ActiveWindow.Zoom <> 100 Then
ActiveWindow.Zoom = 100
End If
DoEvents
Loop While True
End Sub
Step 6 – Run the Code
- Keep the cursor on the code and press F5 to run it.
- Go back to the worksheet.
Step 7 – Observe the Results
You won’t be able to zoom the page.
You need to run the code every time you reopen the document.
Things to Remember
- Save the file as a macro-enabled workbook.
Download Practice Workbook
Download the Excel file.
Related Articles
- How to Zoom Out in Excel
- How to Zoom in Excel Graph
- How to Zoom in on Map Chart in Excel
- How to Zoom in When Zoom Slider Is Not Working in Excel
<<Go Back to How to Zoom in Excel | Excel Worksheets | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!