{"id":4531,"date":"2016-06-02T20:38:30","date_gmt":"2016-06-02T20:38:30","guid":{"rendered":"http:\/\/www.learnexcelmacro.com\/wp\/?p=4531"},"modified":"2022-07-25T19:53:03","modified_gmt":"2022-07-25T19:53:03","slug":"vba-to-zoom-in-a-graph-in-excel","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/","title":{"rendered":"Button to Zoom in a Graph in Excel – [Method 1]"},"content":{"rendered":"

I wish Microsoft Excel has a built-in feature to Zoom-in and Zoom out a graph made in Excel \ud83d\ude42 like many other web applications. But not to worry, you can easily create one to simulate the Zoom-in and Zoom out feature on an Excel graph. There are more than one workaround to achieve this. Though each workarounds are having few limitations. Therefore based on what suits you the best, you can choose.
\nIn this article I will explain you one of those workarounds available.<\/p>\n

\"zoom

zoom in Graph<\/p><\/div>\n

 <\/p>\n

Step by Step procedure to create Zoom-in button<\/h2>\n

Here in the first method, I will explain you a very simple method. I am simply creating a button and on click event of that button, I will resize the graph.<\/p>\n

Steps:<\/h3>\n

1. Create two buttons and name it as “Zoom+” and “Zoom-” or whatever you prefer.
\n2. For Zoom+ button copy and paste the following code in click event of the button:<\/p>\n

\r\nPrivate Sub zoomin_Click()\r\n    With ActiveSheet.Shapes(\"chartName\")\r\n        ' set to true it if you want to resize\r\n        ' the graph in proper ratio. In that case\r\n        ' you need to provide either of the dimension\r\n        ' Width or Height. NOT BOTH\r\n        .LockAspectRatio = msoTrue\r\n        .Width = 300\r\n        '.Height = 100\r\n    End With\r\n    zoomin.Visible = False 'Make alternate buttons visible\r\n    zoomout.Visible = True\r\nEnd Sub\r\n<\/code><\/pre>\n

3. For Zoom- button copy and paste the following code in click event of the button:<\/p>\n

\r\nPrivate Sub zoomout_Click()\r\n    With ActiveSheet.Shapes(\"chartName\")\r\n        ' set to true it if you want to resize\r\n        ' the graph in proper ratio. In that case\r\n        ' you need to provide either of the dimension\r\n        ' Width or Height. NOT BOTH\r\n        .LockAspectRatio = msoTrue\r\n        .Width = 180\r\n        '.Height = 100\r\n    End With\r\n    zoomin.Visible = True 'Make alternate buttons visible\r\n    zoomout.Visible = False\r\nEnd Sub\r\n<\/code><\/pre>\n

4. That’s it. You are done now. Your Zoom-in and Zoom out feature is built in excel graph.<\/p>\n

Limitations in this method<\/h3>\n

1. You need to add 2 buttons for each of your graphs.
\n2. For each button, you need to write separate code.
\n3. If you have got more than one graphs aligned in same sheet, on zooming-in a graph, it may overlap to another graph
\n4. Zoom-in and Zoom out size is hard-coded.<\/p><\/blockquote>\n

Dear readers, in my next article, I will explain you the another method where some of the above limitations will be resolved meanwhile download this file and play-around \ud83d\ude42<\/strong><\/a> it is absolutely FREE \ud83d\ude00<\/p>\n<\/span>","protected":false},"excerpt":{"rendered":"

I wish Microsoft Excel has a built-in feature to Zoom-in and Zoom out a graph made in Excel \ud83d\ude42 like many other web applications. But not to worry, you can easily create one to simulate the Zoom-in and Zoom out feature on an Excel graph. There are more than one workaround to achieve this. Though […]<\/p>\n","protected":false},"author":45,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[1246,1679,1675],"tags":[],"class_list":["post-4531","post","type-post","status-publish","format-standard","hentry","category-macro","category-excel-macro-beginner","category-excel-macro-for-beginners"],"yoast_head":"\nZoom In and Zoom Out button for Excel charts and Graphs<\/title>\n<meta name=\"description\" content=\"Many methods to make button to zoom in and zoom out a graph or charts in excel sheet using simple Excel VBA, Macros, formulas and some spreadsheet functions.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Button to Zoom in a Graph in Excel - [Method 1]\" \/>\n<meta property=\"og:description\" content=\"Many methods to make button to zoom in and zoom out a graph or charts in excel sheet using simple Excel VBA, Macros, formulas and some spreadsheet functions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/\" \/>\n<meta property=\"og:site_name\" content=\"Let's excel in Excel\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/vmlogger\" \/>\n<meta property=\"article:author\" content=\"http:\/\/www.facebook.com\/vmlogger\" \/>\n<meta property=\"article:published_time\" content=\"2016-06-02T20:38:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-25T19:53:03+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/learnexcelmacro.com\/wp\/wp-content\/uploads\/sites\/11\/2016\/06\/zoom.jpg\" \/>\n<meta name=\"author\" content=\"Vishwamitra Mishra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/www.twitter.com\/learnexcelmacro\" \/>\n<meta name=\"twitter:site\" content=\"@learnexcelmacro\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vishwamitra Mishra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/\"},\"author\":{\"name\":\"Vishwamitra Mishra\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"headline\":\"Button to Zoom in a Graph in Excel – [Method 1]\",\"datePublished\":\"2016-06-02T20:38:30+00:00\",\"dateModified\":\"2022-07-25T19:53:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/\"},\"wordCount\":291,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"image\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2016\/06\/zoom.jpg\",\"articleSection\":[\"Excel Macro\",\"Excel Macro Beginner\",\"Excel Macro Tutorial\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/\",\"url\":\"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/\",\"name\":\"Zoom In and Zoom Out button for Excel charts and Graphs\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2016\/06\/zoom.jpg\",\"datePublished\":\"2016-06-02T20:38:30+00:00\",\"dateModified\":\"2022-07-25T19:53:03+00:00\",\"description\":\"Many methods to make button to zoom in and zoom out a graph or charts in excel sheet using simple Excel VBA, Macros, formulas and some spreadsheet functions.\",\"breadcrumb\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/#primaryimage\",\"url\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2016\/06\/zoom.jpg\",\"contentUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2016\/06\/zoom.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/vmlogger.com\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Excel Macro\",\"item\":\"https:\/\/vmlogger.com\/excel\/macro\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Button to Zoom in a Graph in Excel – [Method 1]\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\",\"url\":\"https:\/\/vmlogger.com\/excel\/\",\"name\":\"Let's excel in Excel\",\"description\":\"Let's share knowledge\",\"publisher\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/vmlogger.com\/excel\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\",\"name\":\"Vishwamitra Mishra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png\",\"contentUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png\",\"width\":528,\"height\":560,\"caption\":\"Vishwamitra Mishra\"},\"logo\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/\"},\"description\":\"My name is Vishwamitra Mishra. Friends Call me Vishwa. I hold a Bachelor\u2019s Degree in Computer Science from D.A.V.V. Indore & currently working as a Technical Lead having over 7 years of experience.\",\"sameAs\":[\"http:\/\/www.learnexcelmacro.com\",\"http:\/\/www.facebook.com\/vmlogger\",\"https:\/\/x.com\/https:\/\/www.twitter.com\/learnexcelmacro\",\"https:\/\/www.youtube.com\/c\/VMLogger\"],\"url\":\"https:\/\/vmlogger.com\/excel\/author\/vishwamitra\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Zoom In and Zoom Out button for Excel charts and Graphs","description":"Many methods to make button to zoom in and zoom out a graph or charts in excel sheet using simple Excel VBA, Macros, formulas and some spreadsheet functions.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/","og_locale":"en_US","og_type":"article","og_title":"Button to Zoom in a Graph in Excel - [Method 1]","og_description":"Many methods to make button to zoom in and zoom out a graph or charts in excel sheet using simple Excel VBA, Macros, formulas and some spreadsheet functions.","og_url":"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/","og_site_name":"Let's excel in Excel","article_publisher":"http:\/\/www.facebook.com\/vmlogger","article_author":"http:\/\/www.facebook.com\/vmlogger","article_published_time":"2016-06-02T20:38:30+00:00","article_modified_time":"2022-07-25T19:53:03+00:00","og_image":[{"url":"http:\/\/learnexcelmacro.com\/wp\/wp-content\/uploads\/sites\/11\/2016\/06\/zoom.jpg"}],"author":"Vishwamitra Mishra","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/www.twitter.com\/learnexcelmacro","twitter_site":"@learnexcelmacro","twitter_misc":{"Written by":"Vishwamitra Mishra","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/#article","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/"},"author":{"name":"Vishwamitra Mishra","@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"headline":"Button to Zoom in a Graph in Excel – [Method 1]","datePublished":"2016-06-02T20:38:30+00:00","dateModified":"2022-07-25T19:53:03+00:00","mainEntityOfPage":{"@id":"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/"},"wordCount":291,"commentCount":2,"publisher":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"image":{"@id":"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/#primaryimage"},"thumbnailUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2016\/06\/zoom.jpg","articleSection":["Excel Macro","Excel Macro Beginner","Excel Macro Tutorial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/","url":"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/","name":"Zoom In and Zoom Out button for Excel charts and Graphs","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/#primaryimage"},"image":{"@id":"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/#primaryimage"},"thumbnailUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2016\/06\/zoom.jpg","datePublished":"2016-06-02T20:38:30+00:00","dateModified":"2022-07-25T19:53:03+00:00","description":"Many methods to make button to zoom in and zoom out a graph or charts in excel sheet using simple Excel VBA, Macros, formulas and some spreadsheet functions.","breadcrumb":{"@id":"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/#primaryimage","url":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2016\/06\/zoom.jpg","contentUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2016\/06\/zoom.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/vmlogger.com\/excel\/2016\/06\/vba-to-zoom-in-a-graph-in-excel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vmlogger.com\/excel\/"},{"@type":"ListItem","position":2,"name":"Excel Macro","item":"https:\/\/vmlogger.com\/excel\/macro\/"},{"@type":"ListItem","position":3,"name":"Button to Zoom in a Graph in Excel – [Method 1]"}]},{"@type":"WebSite","@id":"https:\/\/vmlogger.com\/excel\/#website","url":"https:\/\/vmlogger.com\/excel\/","name":"Let's excel in Excel","description":"Let's share knowledge","publisher":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vmlogger.com\/excel\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5","name":"Vishwamitra Mishra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/","url":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png","contentUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png","width":528,"height":560,"caption":"Vishwamitra Mishra"},"logo":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/"},"description":"My name is Vishwamitra Mishra. Friends Call me Vishwa. I hold a Bachelor\u2019s Degree in Computer Science from D.A.V.V. Indore & currently working as a Technical Lead having over 7 years of experience.","sameAs":["http:\/\/www.learnexcelmacro.com","http:\/\/www.facebook.com\/vmlogger","https:\/\/x.com\/https:\/\/www.twitter.com\/learnexcelmacro","https:\/\/www.youtube.com\/c\/VMLogger"],"url":"https:\/\/vmlogger.com\/excel\/author\/vishwamitra\/"}]}},"_links":{"self":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts\/4531"}],"collection":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/comments?post=4531"}],"version-history":[{"count":0,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts\/4531\/revisions"}],"wp:attachment":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/media?parent=4531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/categories?post=4531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/tags?post=4531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}