{"id":247,"date":"2013-02-26T03:22:49","date_gmt":"2013-02-26T03:22:49","guid":{"rendered":"http:\/\/excelvbatutor.com\/?page_id=247"},"modified":"2020-04-23T11:04:23","modified_gmt":"2020-04-23T11:04:23","slug":"excel-vba-lesson-1","status":"publish","type":"page","link":"https:\/\/excelvbatutor.com\/index.php\/excel-vba-lesson-1\/","title":{"rendered":"Excel VBA Lesson 1: Introduction to Excel VBA"},"content":{"rendered":"<h4 style=\"text-align: center;\"><strong><a href=\"http:\/\/excelvbatutor.com\/index.php\/tutorial\/\">[Contents]<\/a>&nbsp;<a href=\"http:\/\/excelvbatutor.com\/index.php\/excel-vba-lesson-2\/\">&lt;&lt;Lesson 2&gt;&gt;<\/a><\/strong><\/h4>\n<h3>1.1 What is Excel VBA?<\/h3>\n<p>Excel VBA is the acronym for Excel&nbsp;<a title=\"Visual Basic Tutorial\" href=\"http:\/\/www.vbtutor.net\/\">Visual Basic<\/a> for Applications. It is an integration of the Microsoft&#8217;s event-driven programming language Visual Basic for Microsoft Office Applications such as Microsoft Excel. Using the Visual Basic programming language in Excel VBA, you can write customized solutions for the Microsoft Excel spreadsheet and complement its built-in functions. In addition, you can actually learn the fundamentals of Visual Basic programming without having to buy a copy of Visual Basic professional. Why is it so? It is because there is a built-in Visual Basic Editor in Microsoft Excel.<br \/>\n<script async=\"\" src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script><br \/>\n<ins class=\"adsbygoogle\" style=\"display: block; text-align: center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-3033628290023372\" data-ad-slot=\"9639157585\"><\/ins><br \/>\n<script><br \/>\n     (adsbygoogle = window.adsbygoogle || []).push({});<br \/>\n<\/script><\/p>\n<h3>1.2&nbsp; How to write Excel VBA Code?<\/h3>\n<p>There are two ways which you can write EXCEL VBA code. The first one is to place a command button on the spreadsheet and start writing codes by clicking the command button while the second one is to write Visual Basic codes within the Visual Basic Editor. Let&#8217;s start with the command button first. In order to place a command button on the spreadsheet, you need to click View on the MS Excel menu bar and then click on the toolbar and finally select the Control Toolbox to launch the control toolbox bar, as shown in Figure 1.1.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.vbtutor.net\/Images\/progra_jan_21_2008_vba1.gif\" alt=\"Excel VBA\" width=\"504\" height=\"452\"><br \/>\n<strong>Figure 1.1<\/strong><\/p>\n<p>The control toolbox comprises various controls. In this lesson, you only use the command button. Now click on the command button and draw it on the spreadsheet, as shown in Figure 1.2<\/p>\n<p><img decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.vbtutor.net\/Images\/progra_jan_21_2008_vba2.gif\" alt=\"\" width=\"95%\" height=\"314\"><br \/>\n<strong>Figure 1.2<\/strong><\/p>\n<p><script async=\"\" src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script><br \/>\n<ins class=\"adsbygoogle\" style=\"display: block; text-align: center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-3033628290023372\" data-ad-slot=\"9639157585\"><\/ins><br \/>\n<script><br \/>\n     (adsbygoogle = window.adsbygoogle || []).push({});<br \/>\n<\/script><br \/>\nNext, &nbsp;click on the command button to bring up the Visual Basic Editor. In the Visual Basic Editor, &nbsp;enter the statements as shown in Figure 1.2. The first statement fills up cell A1 to cell A10 with the phrase &#8220;Visual Basic&#8221; while the second statement adds the value in cell A11 and cell B11&nbsp; and then shows the sum in cell C11. It is that simple.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.vbtutor.net\/Images\/progra_jan_21_2008_vba3.gif\" alt=\"\" width=\"734\" height=\"480\"><\/p>\n<p>Figure 1.2<\/p>\n<p>Run the macro and you can see the output as shown in Figure 1.3 &nbsp;below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.vbtutor.net\/Images\/progra_jan_21_2008_vba4.gif\" alt=\"\" width=\"634\" height=\"364\"><\/p>\n<p><strong>Figure 1.3<\/strong><\/p>\n<h4 style=\"text-align: center;\"><strong><a href=\"https:\/\/excelvbatutor.com\/index.php\/tutorial\/\">[Contents]<\/a>&nbsp;<a href=\"https:\/\/excelvbatutor.com\/index.php\/excel-vba-lesson-2\/\">&lt;&lt;Lesson 2&gt;&gt;<\/a><\/strong><\/h4>\n","protected":false},"excerpt":{"rendered":"<p>[Contents]&nbsp;&lt;&lt;Lesson 2&gt;&gt; 1.1 What is Excel VBA? Excel VBA is the acronym for Excel&nbsp;Visual Basic for Applications. It is an integration of the Microsoft&#8217;s event-driven programming language Visual Basic for Microsoft Office Applications such as Microsoft Excel. Using the Visual Basic programming language in Excel VBA, you can write customized solutions for the Microsoft Excel &hellip; <a href=\"https:\/\/excelvbatutor.com\/index.php\/excel-vba-lesson-1\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Excel VBA Lesson 1: Introduction to Excel VBA&#8221;<\/span><\/a><\/p>\n","protected":false},"author":5012,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-247","page","type-page","status-publish","hentry","category-general"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Excel VBA Lesson 1: Introduction to Excel VBA - Learn Excel VBA Online \u2013 Step-by-Step Tutorials &amp; Courses | ExcelVBATutor<\/title>\n<meta name=\"description\" content=\"The]is Excel VBA article introduces and explains the concepts of Excel VBA\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/excelvbatutor.com\/vba_lesson1.htm\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Excel VBA Lesson 1: Introduction to Excel VBA - Learn Excel VBA Online \u2013 Step-by-Step Tutorials &amp; Courses | ExcelVBATutor\" \/>\n<meta property=\"og:description\" content=\"The]is Excel VBA article introduces and explains the concepts of Excel VBA\" \/>\n<meta property=\"og:url\" content=\"https:\/\/excelvbatutor.com\/vba_lesson1.htm\" \/>\n<meta property=\"og:site_name\" content=\"Learn Excel VBA Online \u2013 Step-by-Step Tutorials &amp; Courses | ExcelVBATutor\" \/>\n<meta property=\"article:modified_time\" content=\"2020-04-23T11:04:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.vbtutor.net\/Images\/progra_jan_21_2008_vba1.gif\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/excelvbatutor.com\/index.php\/excel-vba-lesson-1\/\",\"url\":\"https:\/\/excelvbatutor.com\/vba_lesson1.htm\",\"name\":\"Excel VBA Lesson 1: Introduction to Excel VBA - Learn Excel VBA Online \u2013 Step-by-Step Tutorials &amp; Courses | ExcelVBATutor\",\"isPartOf\":{\"@id\":\"https:\/\/excelvbatutor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/excelvbatutor.com\/vba_lesson1.htm#primaryimage\"},\"image\":{\"@id\":\"https:\/\/excelvbatutor.com\/vba_lesson1.htm#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.vbtutor.net\/Images\/progra_jan_21_2008_vba1.gif\",\"datePublished\":\"2013-02-26T03:22:49+00:00\",\"dateModified\":\"2020-04-23T11:04:23+00:00\",\"description\":\"The]is Excel VBA article introduces and explains the concepts of Excel VBA\",\"breadcrumb\":{\"@id\":\"https:\/\/excelvbatutor.com\/vba_lesson1.htm#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/excelvbatutor.com\/vba_lesson1.htm\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/excelvbatutor.com\/vba_lesson1.htm#primaryimage\",\"url\":\"https:\/\/www.vbtutor.net\/Images\/progra_jan_21_2008_vba1.gif\",\"contentUrl\":\"https:\/\/www.vbtutor.net\/Images\/progra_jan_21_2008_vba1.gif\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/excelvbatutor.com\/vba_lesson1.htm#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/excelvbatutor.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Excel VBA Lesson 1: Introduction to Excel VBA\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/excelvbatutor.com\/#website\",\"url\":\"https:\/\/excelvbatutor.com\/\",\"name\":\"Learn Excel VBA Online \u2013 Step-by-Step Tutorials &amp; Courses | ExcelVBATutor\",\"description\":\"Master Excel VBA with free tutorials, examples, and personalized guidance. Perfect for beginners and advanced users looking to automate Excel.\",\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Excel VBA Lesson 1: Introduction to Excel VBA - Learn Excel VBA Online \u2013 Step-by-Step Tutorials &amp; Courses | ExcelVBATutor","description":"The]is Excel VBA article introduces and explains the concepts of Excel VBA","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:\/\/excelvbatutor.com\/vba_lesson1.htm","og_locale":"en_US","og_type":"article","og_title":"Excel VBA Lesson 1: Introduction to Excel VBA - Learn Excel VBA Online \u2013 Step-by-Step Tutorials &amp; Courses | ExcelVBATutor","og_description":"The]is Excel VBA article introduces and explains the concepts of Excel VBA","og_url":"https:\/\/excelvbatutor.com\/vba_lesson1.htm","og_site_name":"Learn Excel VBA Online \u2013 Step-by-Step Tutorials &amp; Courses | ExcelVBATutor","article_modified_time":"2020-04-23T11:04:23+00:00","og_image":[{"url":"https:\/\/www.vbtutor.net\/Images\/progra_jan_21_2008_vba1.gif","type":"","width":"","height":""}],"twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/excelvbatutor.com\/index.php\/excel-vba-lesson-1\/","url":"https:\/\/excelvbatutor.com\/vba_lesson1.htm","name":"Excel VBA Lesson 1: Introduction to Excel VBA - Learn Excel VBA Online \u2013 Step-by-Step Tutorials &amp; Courses | ExcelVBATutor","isPartOf":{"@id":"https:\/\/excelvbatutor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/excelvbatutor.com\/vba_lesson1.htm#primaryimage"},"image":{"@id":"https:\/\/excelvbatutor.com\/vba_lesson1.htm#primaryimage"},"thumbnailUrl":"https:\/\/www.vbtutor.net\/Images\/progra_jan_21_2008_vba1.gif","datePublished":"2013-02-26T03:22:49+00:00","dateModified":"2020-04-23T11:04:23+00:00","description":"The]is Excel VBA article introduces and explains the concepts of Excel VBA","breadcrumb":{"@id":"https:\/\/excelvbatutor.com\/vba_lesson1.htm#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/excelvbatutor.com\/vba_lesson1.htm"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/excelvbatutor.com\/vba_lesson1.htm#primaryimage","url":"https:\/\/www.vbtutor.net\/Images\/progra_jan_21_2008_vba1.gif","contentUrl":"https:\/\/www.vbtutor.net\/Images\/progra_jan_21_2008_vba1.gif"},{"@type":"BreadcrumbList","@id":"https:\/\/excelvbatutor.com\/vba_lesson1.htm#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/excelvbatutor.com\/"},{"@type":"ListItem","position":2,"name":"Excel VBA Lesson 1: Introduction to Excel VBA"}]},{"@type":"WebSite","@id":"https:\/\/excelvbatutor.com\/#website","url":"https:\/\/excelvbatutor.com\/","name":"Learn Excel VBA Online \u2013 Step-by-Step Tutorials &amp; Courses | ExcelVBATutor","description":"Master Excel VBA with free tutorials, examples, and personalized guidance. Perfect for beginners and advanced users looking to automate Excel.","inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/excelvbatutor.com\/index.php\/wp-json\/wp\/v2\/pages\/247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/excelvbatutor.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/excelvbatutor.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/excelvbatutor.com\/index.php\/wp-json\/wp\/v2\/users\/5012"}],"replies":[{"embeddable":true,"href":"https:\/\/excelvbatutor.com\/index.php\/wp-json\/wp\/v2\/comments?post=247"}],"version-history":[{"count":35,"href":"https:\/\/excelvbatutor.com\/index.php\/wp-json\/wp\/v2\/pages\/247\/revisions"}],"predecessor-version":[{"id":3336,"href":"https:\/\/excelvbatutor.com\/index.php\/wp-json\/wp\/v2\/pages\/247\/revisions\/3336"}],"wp:attachment":[{"href":"https:\/\/excelvbatutor.com\/index.php\/wp-json\/wp\/v2\/media?parent=247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelvbatutor.com\/index.php\/wp-json\/wp\/v2\/categories?post=247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelvbatutor.com\/index.php\/wp-json\/wp\/v2\/tags?post=247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}