Hello,

I found this cool script online, but it doesn't seem to be working properly for me. I was wondering if one of you geniuses could help me out please!

Sub FitToPage()
Application.ScreenUpdating = False
For i = 20 To 100
ActiveSheet.PageSetup.Zoom = i
numpages = ExecuteExcel4Macro("Get.Document(50)")
If numpages > 1 Then
ActiveSheet.PageSetup.Zoom = i - 1
Exit For
End If
Next
Application.ScreenUpdating = True
End Sub
Basically, the numpages is not being updated. The code will zoom to 20% and keep going to 100%, but the numpages value is always staying at 1 for each i, and I can't seem to figure out why...

Any help is very much appreciated!!