Zoom In and Zoom out

  • Thread starter Thread starter Qaspec
  • Start date Start date
Q

Qaspec

I currently have my sheet set to a 45% zoom. I have a spin
button named "SB1" on "ReportSheet". I would like the spin
button go through views of 55%,65%, and 75% when the user
clicks the spin. How would I write the command?

Thx
 
Right-click the spin button to go to format control and to
assign a macro. With the example I give you, the cell
link is $D$1, which is Cells(1, 4). You can place this
cell link right underneath the spin button so it can't be
seen.

With the format control, under the control tab, the
minimum value is 1, the maximum value is 4, and the
incremental change is 1, to match the code.

Here's the code:

Sub Spinner1_Change()

If Cells(1, 4).Value = 1 Then
ActiveWindow.Zoom = 75
ElseIf Cells(1, 4).Value = 2 Then
ActiveWindow.Zoom = 65
ElseIf Cells(1, 4).Value = 3 Then
ActiveWindow.Zoom = 55
ElseIf Cells(1, 4).Value = 4 Then
ActiveWindow.Zoom = 45
End If

End Sub

I hope that helps. Modify it to match your specific
requirements.

Rick
 
Back
Top