zoom macro

chobanne

Active Member
Joined
Jul 3, 2011
Messages
269
I wonder if this is possible:

I need a button macro who will, by click on it, zoom in range A1:J15 else if u click it again, it will zoom out to previous condition. Thank you
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try:

Code:
Sub Button1_Click()
    With ActiveWindow
        If .Zoom = 100 Then
            Range("A1:J15").Select
            .Zoom = True
        Else
            .Zoom = 100
        End If
    End With
End Sub

assigned to a button from the Forms Toolbar.
 
Upvote 0
thank you it works fine. i change the range to K1:T15, is there a chance to second click when it turn it to 100% zoom make left upper corner on screen to be cell A1, now for me is F1
 
Last edited:
Upvote 0
Try:

Code:
Sub Button1_Click()
    With ActiveWindow
        If .Zoom = 100 Then
            Range("A1:J15").Select
            .Zoom = True
        Else
            .Zoom = 100
        End If
    End With
End Sub

assigned to a button from the Forms Toolbar.

can u make on zoom out the left upper corner on screen to be cell A1
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,740
Members
452,940
Latest member
rootytrip

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