Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to create a button to set specific Zoom and apply it to all sheets.
I am using IE Plugin.
I was unable to create both actions in one macro, so I seperated it into 2 macros, but it only works if I am using 2 buttons (instead of one button with 2 actions).
the macros I am using are:
1. For Zoom:
sub ZOOM
set mysheet=ActiveDocument.ActiveSheet
set sp=mysheet.GetProperties
sp.ZoomFactor = 1.25
mysheet.SetProperties sp
End sub
2. To apply to all sheets:
sub ApplyZoom
ActiveDocument.ActiveSheet.ApplyZoomToAllSheets
End sub
Any idea how I can solve it?
thanks!
Hi Karin,
You can use below code.
Sub Zoom
For i = 0 to ActiveDocument.NoOfSheets - 1
set mysheet=ActiveDocument.Sheets(ActiveDocument.Sheets(i).GetProperties.Name)
set sp=mysheet.GetProperties
sp.ZoomFactor = 1.25
mysheet.SetProperties sp
Next
End sub
Hi Karin,
You can use below code.
Sub Zoom
For i = 0 to ActiveDocument.NoOfSheets - 1
set mysheet=ActiveDocument.Sheets(ActiveDocument.Sheets(i).GetProperties.Name)
set sp=mysheet.GetProperties
sp.ZoomFactor = 1.25
mysheet.SetProperties sp
Next
End sub
Thank you Tamil, it works perfectly
Hi karin, if Tamil answer was what you are looking for, please check Tamil's answer as the correct answer to close the thread.
This helps other users with similar issue to find the answer and others (like me) to not use time reading an already solved question.