Return to Snippet

Revision: 23762
at February 12, 2010 10:53 by mprabhuram


Initial Code
Sub MyZoomIn()
   Dim ZP As Integer
   ZP = Int(ActiveWindow.Zoom * 1.1)
   If ZP > 400 Then ZP = 400
   ActiveWindow.Zoom = ZP
End Sub

Initial URL
http://excel.tips.net/Pages/T002731_Zooming_With_the_Keyboard.html

Initial Description
Notice that the macro only allows you to zoom in up to 400%. This is because Excel allows you to only zoom that high, and any higher would generate an error. A slight variation on the same theme results in a macro I call MyZoomOut. It zooms out of (reduces) a worksheet by 10%:

Initial Title
ZoomIn Excel Macro

Initial Tags

                                

Initial Language
Visual Basic