Help please :( Zoom all Worksheets defined by cell value

supa2532

New Member
Joined
Jan 11, 2019
Messages
3
Hi there, I'm losing my mind with this can someone please save me? I think I need to determine a cell but not sure how?

I am looking for all worksheets to zoom to the value I enter into Cell G138? Doesn't work?

Any help very much appreciated!

Sub Zoom()
'UpdatebyExtendoffice20171215
Dim I As Long
Dim xActSheet As Worksheet
Set xActSheet = ActiveSheet
For I = 1 To ThisWorkbook.Sheets.Count
Sheets(I).Activate
ActiveWindow.Zoom = G138
Next
xActSheet.Select
End Sub
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
I think I need to tell excel to look up the value in a cell 'on a particular sheet'. But how I have no idea?
 
Upvote 0
How about
Code:
Sub Zoom()
'UpdatebyExtendoffice20171215
Dim I As Long
Dim xActSheet As Worksheet
Set xActSheet = ActiveSheet
For I = 1 To ThisWorkbook.Sheets.Count
   Sheets(I).Activate
   ActiveWindow.Zoom = Sheets("[COLOR=#ff0000]input[/COLOR]").Range("G138").Value
Next
xActSheet.Select
End Sub
Change sheet name in red to suit
 
Upvote 0
How about
Code:
Sub Zoom()
'UpdatebyExtendoffice20171215
Dim I As Long
Dim xActSheet As Worksheet
Set xActSheet = ActiveSheet
For I = 1 To ThisWorkbook.Sheets.Count
   Sheets(I).Activate
   ActiveWindow.Zoom = Sheets("[COLOR=#ff0000]input[/COLOR]").Range("G138").Value
Next
xActSheet.Select
End Sub
Change sheet name in red to suit

You sir are a legend! Thank you so much! Very helpful and works a treat :)
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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