Apply Zoom VBA to Whole Workbook

SaraWitch

Active Member
Joined
Sep 29, 2015
Messages
378
Office Version
  1. 365
Platform
  1. Windows
Hello peeps!

Does anyone know how to apply the following formula to the whole workbook? (I've tried ActiveWorkbook but that didn't work!)

VBA Code:
Private Sub Workbook_Open()
ActiveWindow.Zoom = 100
End Sub

Ta very muchly! 😊
 
Is the Please Note sheet visible?
 
Upvote 0

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
That shouldn't make any difference as you aren't trying to do anything to it. That's the only reason I can think of that you would get that error (it's the only Activate line I can see).
 
Upvote 0
Okay, I'll revert to my original coding as that's working as expected. Thank you for your help anyway, Rory 😊
 
Upvote 0
Coding in post #8 was my original coding and is working as expected. Coding in post #4 is giving me the error. ;)
 
Upvote 0
It’s very confusing if you post code and say it’s causing an error but you’re actually talking about other code. Which line is causing the error?
 
Upvote 0
Apologies, Rory.

The code in my post #8 is working (my original).

When speaking of errors, I am referring to the code you kindly offered as a solution in post #4. I don't know which line is causing this, but the error message for this coding (post #4) is:
Run-time error '1004':
Method 'Activate' of object'_Worksheet' failed
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top