Zoom to 75%

H

Hari

Hi,

I have 2 worksheets in my excel workbook created from
Visual Basic. I am trying to set the zoom % to 75% for
both the worksheets as the sheets are quite huge. I am
using the following code to achieve this:

Dim wnd As Excel.Window

For Each wnd In xlApp.Windows
wnd.Zoom = 75
Next

But this is only setting the zoom to 75% for the last
worksheet probably the active worksheet. How do I set the
zoom for both the worksheet? any help would be highly
appreciated.

Thanks & Regards,
Hari
 
C

Charles Maxson

Hari,

Here's a sample that works....

Sub Zoom()

Dim ws As Worksheet
Dim wsActive As Worksheet

Application.ScreenUpdating = False
Set wsActive = ActiveSheet

For Each ws In ActiveWorkbook.Worksheets
ws.Select
ActiveWindow.Zoom = 75
Next

wsActive.Select

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top