Setting Sheet Display Zoom Magnification in VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Greetings! I am working in Excel 2000 and am looking for the VBA command to
allow me to set the Worksheet Zoom Magnification programmatically. The
toolbar has the handy little dropdown list box, but I haven't been able to
figure out how to do this in code. I found the Zoom command, but that seems
to refer only to page setup for printing.

Thanks in advance!
 
Hi, ActiveWindow.Zoom = 85 would set the zoom to 85%.
In the VBA editor if you press F2 it will bring up a search window to
search the VBA libraries for built in functions, properties, and
methods. This is very helpful to find things like this.

HTH--Lonnie M.
 
Thanks, Lonnie!

That seemed the logical choice, but when I checked the Excel help files it
kept referring to changing the zoom for printing. VBA's help file leave a lot
to be desired.

Thanks again for your help!
 
Kevin,
Another easy way to find this kind of information out is to record a
simple macro. I just did a "Tools, Macro, Record new macro", typed in
Zoom for the name, then zoomed to a couple of different settings and
stopped recording. Then I went to the VBA editor and there was the code.
 
Dave:

You're absolutely right. I have used that method of recording a macro then
looking at the code in the past and I'm not sure why I didn't think of it
this time.

Is it Friday, yet? :-)

Thanks!
 
Back
Top