{"id":12110,"date":"2011-12-17T20:06:36","date_gmt":"2011-12-17T20:06:36","guid":{"rendered":"http:\/\/www.learnexcelmacro.com\/?p=1076"},"modified":"2011-12-17T20:06:36","modified_gmt":"2011-12-17T20:06:36","slug":"use-of-spin-button-in-excel","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/","title":{"rendered":"Excel Macro Tutorial : VBA Spin Button"},"content":{"rendered":"

In the previous Article How to write Excel Macro – Your First Excel Macro<\/a><\/strong> of <\/a>Excel Macro Tutorial<\/strong>, you have seen how to write Excel Macro. Also in Previous Tutorials, you have seen all the basic concept of Excel Macro.
\n<\/p>\n

In this Article I am going to show you how to Add and Use Spin Button.
\n
\nSpin Button:<\/strong> Spin button is an ActiveX Control which have Two Buttons Up and Down. Both the buttons always remain together but function separately. Generally you might have seen this button in many dialog box where user wants to increase or decrease values in a Text box or anywhere by clicking on Up or Down button correspondingly.
\n 
\n
\"\"<\/a>
\n<\/p>\n

How to Add VBA Spin Button in your Excel Sheet<\/h3>\n

Step 1.<\/strong>Go to Developer’s Tab (How to Add Developer’s Add in to the Ribbon<\/a>)
\nStep 2.<\/strong>Go to to Controls Section -> Click on Arrow on INSERT button
\nStep 3.<\/strong>Click on ActiveX Spin Button
\nStep 4.<\/strong>Now Drag the Place where you want to Place that button and re-size as per your requirement.<\/strong><\/strong><\/strong>
\n
\n

\"Add<\/a>

Add Spin Button to Excel<\/p><\/div>
\n
\nNow you got Added Spin Button to your Excel Sheet. Now we will learn how to make this button working by writing a simple line of code.
\n<\/p>\n

How to Use VBA Spin Button in your Excel Sheet<\/h3>\n

Step 1.<\/strong>Double Click on the Control.
\nStep 2.<\/strong>You are taken to the Visual Basic Editor of the Excel
\nStep 3.<\/strong>Here Select the Name of your Control.
\nStep 4.<\/strong>Now you Select SpinUp<\/strong> and SpinDown<\/strong>Events from the Even Drop down as shown below in image:
\n
\n

\"Working<\/a>

Working with Spin Button<\/p><\/div>
\n
\nStep 5.<\/strong>Now Copy paste the below Code for your SpinUp Event and SpinDown Event
\n<\/p>\n

SpinUp Event<\/h2>\n
\nPrivate Sub SpinButton1_Spinup()\n    With Range(\"A1\")\n        .Value = WorksheetFunction.Min(150, .Value + 10)\n    End With\nEnd Sub<\/code><\/pre>\n

<\/p>\n

SpinDown Event<\/h2>\n
Private Sub SpinButton1_Spindown()\n    With Range(\"A1\")\n        .Value = WorksheetFunction.Max(50, .Value - 10)\n    End With\nEnd Sub<\/code><\/pre>\n

in Above Example, Spin button will increase or decrease the Value of Cell A1 by 10 on clicking on Up and Down button respectively. Also down button will not decrease the Value less than 50 and also Up button will not allow to increase for more than 150.<\/strong>
\n
\nThis way you can customize it as per your requirement.<\/p>\n

If you face any issue or doubt about this feel free to contact me on info@learnexcelmacro.com<\/h2>\n

<\/p>\n\n\n
\n 
\nTo Check out more Excel Macro Tutorials, visit Excel Macro Tutorial<\/a><\/strong>
\n\n<\/td>\n<\/tr>\n<\/table>\n<\/span>","protected":false},"excerpt":{"rendered":"

In the previous Article How to write Excel Macro – Your First Excel Macro of Excel Macro Tutorial, you have seen how to write Excel Macro. Also in Previous Tutorials, you have seen all the basic concept of Excel Macro. In this Article I am going to show you how to Add and Use Spin […]<\/p>\n","protected":false},"author":45,"featured_media":1077,"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,1675],"tags":[],"class_list":["post-12110","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-macro","category-excel-macro-for-beginners"],"yoast_head":"\nExcel Macro Tutorial : VBA Spin Button - Let's excel in Excel<\/title>\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\/2011\/12\/use-of-spin-button-in-excel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Excel Macro Tutorial : VBA Spin Button\" \/>\n<meta property=\"og:description\" content=\"In the previous Article How to write Excel Macro – Your First Excel Macro of Excel Macro Tutorial, you have seen how to write Excel Macro. Also in Previous Tutorials, you have seen all the basic concept of Excel Macro. In this Article I am going to show you how to Add and Use Spin […]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-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=\"2011-12-17T20:06:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/vmlogger.com_-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\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\/2011\/12\/use-of-spin-button-in-excel\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/\"},\"author\":{\"name\":\"Vishwamitra Mishra\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"headline\":\"Excel Macro Tutorial : VBA Spin Button\",\"datePublished\":\"2011-12-17T20:06:36+00:00\",\"dateModified\":\"2011-12-17T20:06:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/\"},\"wordCount\":392,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"image\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/#primaryimage\"},\"thumbnailUrl\":\"\",\"articleSection\":[\"Excel Macro\",\"Excel Macro Tutorial\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/\",\"url\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/\",\"name\":\"Excel Macro Tutorial : VBA Spin Button - Let's excel in Excel\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/#primaryimage\"},\"thumbnailUrl\":\"\",\"datePublished\":\"2011-12-17T20:06:36+00:00\",\"dateModified\":\"2011-12-17T20:06:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/#primaryimage\",\"url\":\"\",\"contentUrl\":\"\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-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\":\"Excel Macro Tutorial : VBA Spin Button\"}]},{\"@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":"Excel Macro Tutorial : VBA Spin Button - Let's excel in Excel","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\/2011\/12\/use-of-spin-button-in-excel\/","og_locale":"en_US","og_type":"article","og_title":"Excel Macro Tutorial : VBA Spin Button","og_description":"In the previous Article How to write Excel Macro – Your First Excel Macro of Excel Macro Tutorial, you have seen how to write Excel Macro. Also in Previous Tutorials, you have seen all the basic concept of Excel Macro. In this Article I am going to show you how to Add and Use Spin […]","og_url":"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-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":"2011-12-17T20:06:36+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/vmlogger.com_-1.png","type":"image\/png"}],"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\/2011\/12\/use-of-spin-button-in-excel\/#article","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/"},"author":{"name":"Vishwamitra Mishra","@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"headline":"Excel Macro Tutorial : VBA Spin Button","datePublished":"2011-12-17T20:06:36+00:00","dateModified":"2011-12-17T20:06:36+00:00","mainEntityOfPage":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/"},"wordCount":392,"commentCount":4,"publisher":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"image":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/#primaryimage"},"thumbnailUrl":"","articleSection":["Excel Macro","Excel Macro Tutorial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/","url":"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/","name":"Excel Macro Tutorial : VBA Spin Button - Let's excel in Excel","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/#primaryimage"},"image":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/#primaryimage"},"thumbnailUrl":"","datePublished":"2011-12-17T20:06:36+00:00","dateModified":"2011-12-17T20:06:36+00:00","breadcrumb":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-in-excel\/#primaryimage","url":"","contentUrl":""},{"@type":"BreadcrumbList","@id":"https:\/\/vmlogger.com\/excel\/2011\/12\/use-of-spin-button-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":"Excel Macro Tutorial : VBA Spin Button"}]},{"@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\/12110"}],"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=12110"}],"version-history":[{"count":0,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts\/12110\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/media?parent=12110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/categories?post=12110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/tags?post=12110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}