ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to create a zoom butom in vba excel (https://www.excelbanter.com/excel-programming/434697-how-create-zoom-butom-vba-excel.html)

vvv

how to create a zoom butom in vba excel
 
hey guys how do I create a button (vba code) that upon each click changes the
zoom of the workshet?

Jacob Skaria

how to create a zoom butom in vba excel
 
You can. Try
'to zoom out
ActiveWindow.Zoom = (ActiveWindow.Zoom-10)

to zoom in
ActiveWindow.Zoom = (ActiveWindow.Zoom+10)

If this post helps click Yes
---------------
Jacob Skaria


"vvv" wrote:

hey guys how do I create a button (vba code) that upon each click changes the
zoom of the workshet?


Dave Peterson

how to create a zoom butom in vba excel
 
You could record a macro to get the syntax and modify that recorded macro to do
what you want.

Then you could place a button from the Forms toolbar on the sheet and assign
this macro to the button.

But an alternative would be to add a couple of buttons to your favorite toolbar
(xl2003 and earlier).

In xl2003 menus:
Tools|Customize|Commands tab|View Category
Scroll down in the commands listbox until you see:
Zoom In
and drag it to your favorite toolbar
Do the same with Zoom out

I don't know if the same icons are available in xl2007 so that you can add them
to the QAT.

By putting these icons on your favorite toolbar (or QAT if available), you'll
have this functionality in all worksheets.


vvv wrote:

hey guys how do I create a button (vba code) that upon each click changes the
zoom of the workshet?


--

Dave Peterson


All times are GMT +1. The time now is 04:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com