ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to zoom in VBA (https://www.excelbanter.com/excel-programming/415188-how-zoom-vba.html)

Jim

How to zoom in VBA
 
I want to zoom the page out like 70% like when you go to View -- Zoom
--70%. How do i write it in VBA? I know PageSetup has the zoom for printing,
I tried it but doesnt actually zoom the sheet. Any help will be much
appreciated! Thanks

Harald Staff[_2_]

How to zoom in VBA
 
When in doubt of syntax, record a macro while doing it manually. You should
get a result like


Sub Macro1()
ActiveWindow.Zoom = 70
End Sub

HTH. Best wishes Harald

"Jim" wrote in message
...
I want to zoom the page out like 70% like when you go to View -- Zoom
--70%. How do i write it in VBA? I know PageSetup has the zoom for
printing,
I tried it but doesnt actually zoom the sheet. Any help will be much
appreciated! Thanks



Tom Hutchins

How to zoom in VBA
 
Sub ZoomTo70()
ActiveWindow.Zoom = 70
End Sub

If you are new to macros), this link to Jon Peltier's site may be helpful:
http://peltiertech.com/WordPress/200...e-elses-macro/

Hope this helps,

Hutch

"Jim" wrote:

I want to zoom the page out like 70% like when you go to View -- Zoom
--70%. How do i write it in VBA? I know PageSetup has the zoom for printing,
I tried it but doesnt actually zoom the sheet. Any help will be much
appreciated! Thanks


Mike H

How to zoom in VBA
 
Hi,

Try this in your code

ActiveWindow.Zoom = 70

Mike

"Jim" wrote:

I want to zoom the page out like 70% like when you go to View -- Zoom
--70%. How do i write it in VBA? I know PageSetup has the zoom for printing,
I tried it but doesnt actually zoom the sheet. Any help will be much
appreciated! Thanks


Jim

How to zoom in VBA
 
Thankyou all! I always forget about recording macros.

"Harald Staff" wrote:

When in doubt of syntax, record a macro while doing it manually. You should
get a result like


Sub Macro1()
ActiveWindow.Zoom = 70
End Sub

HTH. Best wishes Harald

"Jim" wrote in message
...
I want to zoom the page out like 70% like when you go to View -- Zoom
--70%. How do i write it in VBA? I know PageSetup has the zoom for
printing,
I tried it but doesnt actually zoom the sheet. Any help will be much
appreciated! Thanks





All times are GMT +1. The time now is 01:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com