{"id":2716,"date":"2017-09-15T04:34:13","date_gmt":"2017-09-15T04:34:13","guid":{"rendered":"http:\/\/excelvbatutor.com\/?p=2716"},"modified":"2018-10-03T05:12:15","modified_gmt":"2018-10-03T05:12:15","slug":"decision-making-excel-vba","status":"publish","type":"post","link":"https:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/","title":{"rendered":"Decision Making in Excel VBA"},"content":{"rendered":"<p>In Excel VBA, we can write decision-making codes based on certain conditions. There are two methods to write decision-making code in Excel VBA, using the If&#8230;..Then&#8230;Else syntax or using the Select Case&#8230;End select syntax.<\/p>\n<p>The syntaxes are exactly the same as VB6.\u00a0 You need to use both the conditional operators and the logical operators together with If&#8230;The&#8230;Else statements and\u00a0Select Case statements.<\/p>\n<p>For example<\/p>\n<p>If sale&gt;1000 Then<\/p>\n<p>bonus=50*sale<\/p>\n<p>Else<\/p>\n<p>Bonus=0<\/p>\n<p>End If<\/p>\n<p>For more information, read the articles below:<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"XYT7UrqHlM\"><p><a href=\"http:\/\/excelvbatutor.com\/index.php\/excel-vba-2010-lesson-10-decision-making-1-if-then-else\/\">Excel 2010 VBA Lesson 10: Using If&#8230;Then&#8230;Else<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/excelvbatutor.com\/index.php\/excel-vba-2010-lesson-10-decision-making-1-if-then-else\/embed\/#?secret=XYT7UrqHlM\" data-secret=\"XYT7UrqHlM\" width=\"600\" height=\"338\" title=\"&#8220;Excel 2010 VBA Lesson 10: Using If&#8230;Then&#8230;Else&#8221; &#8212; Excel VBA Tutorial\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"nDP8Z3BzJF\"><p><a href=\"http:\/\/excelvbatutor.com\/index.php\/excel-vba-lesson-11-decision-making-2-select-case-end-select\/\">Excel 2010 VBA Lesson 11: Using Select Case<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/excelvbatutor.com\/index.php\/excel-vba-lesson-11-decision-making-2-select-case-end-select\/embed\/#?secret=nDP8Z3BzJF\" data-secret=\"nDP8Z3BzJF\" width=\"600\" height=\"338\" title=\"&#8220;Excel 2010 VBA Lesson 11: Using Select Case&#8221; &#8212; Excel VBA Tutorial\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Excel VBA, we can write decision-making codes based on certain conditions. There are two methods to write decision-making code in Excel VBA, using the If&#8230;..Then&#8230;Else syntax or using the Select Case&#8230;End select syntax. The syntaxes are exactly the same as VB6.\u00a0 You need to use both the conditional operators and the logical operators together &hellip; <a href=\"https:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Decision Making in Excel VBA&#8221;<\/span><\/a><\/p>\n","protected":false},"author":5012,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[6],"class_list":["post-2716","post","type-post","status-publish","format-standard","hentry","category-decison-making","tag-if-statement"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Decision Making in Excel VBA - Learn Excel VBA Online \u2013 Step-by-Step Tutorials &amp; Courses | ExcelVBATutor<\/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:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Decision Making in Excel VBA - Learn Excel VBA Online \u2013 Step-by-Step Tutorials &amp; Courses | ExcelVBATutor\" \/>\n<meta property=\"og:description\" content=\"In Excel VBA, we can write decision-making codes based on certain conditions. There are two methods to write decision-making code in Excel VBA, using the If&#8230;..Then&#8230;Else syntax or using the Select Case&#8230;End select syntax. The syntaxes are exactly the same as VB6.\u00a0 You need to use both the conditional operators and the logical operators together &hellip; Continue reading &quot;Decision Making in Excel VBA&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/\" \/>\n<meta property=\"og:site_name\" content=\"Learn Excel VBA Online \u2013 Step-by-Step Tutorials &amp; Courses | ExcelVBATutor\" \/>\n<meta property=\"article:published_time\" content=\"2017-09-15T04:34:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-10-03T05:12:15+00:00\" \/>\n<meta name=\"author\" content=\"Liew Voon Kiong\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Liew Voon Kiong\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/\"},\"author\":{\"name\":\"Liew Voon Kiong\",\"@id\":\"https:\/\/excelvbatutor.com\/#\/schema\/person\/43d141df324e8eb01509c5f5d8a4a76a\"},\"headline\":\"Decision Making in Excel VBA\",\"datePublished\":\"2017-09-15T04:34:13+00:00\",\"dateModified\":\"2018-10-03T05:12:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/\"},\"wordCount\":108,\"keywords\":[\"If statement\"],\"articleSection\":[\"Decision making\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/\",\"url\":\"https:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/\",\"name\":\"Decision Making in Excel VBA - Learn Excel VBA Online \u2013 Step-by-Step Tutorials &amp; Courses | ExcelVBATutor\",\"isPartOf\":{\"@id\":\"https:\/\/excelvbatutor.com\/#website\"},\"datePublished\":\"2017-09-15T04:34:13+00:00\",\"dateModified\":\"2018-10-03T05:12:15+00:00\",\"author\":{\"@id\":\"https:\/\/excelvbatutor.com\/#\/schema\/person\/43d141df324e8eb01509c5f5d8a4a76a\"},\"breadcrumb\":{\"@id\":\"https:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/excelvbatutor.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Decision Making in 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\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/excelvbatutor.com\/#\/schema\/person\/43d141df324e8eb01509c5f5d8a4a76a\",\"name\":\"Liew Voon Kiong\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/excelvbatutor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3e3750a9c46828b988fc9432ec548bc847e79637d0971da3f409da2ec81297df?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3e3750a9c46828b988fc9432ec548bc847e79637d0971da3f409da2ec81297df?s=96&d=mm&r=g\",\"caption\":\"Liew Voon Kiong\"},\"url\":\"https:\/\/excelvbatutor.com\/index.php\/author\/ajs7051vba\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Decision Making in Excel VBA - Learn Excel VBA Online \u2013 Step-by-Step Tutorials &amp; Courses | ExcelVBATutor","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\/index.php\/2017\/09\/15\/decision-making-excel-vba\/","og_locale":"en_US","og_type":"article","og_title":"Decision Making in Excel VBA - Learn Excel VBA Online \u2013 Step-by-Step Tutorials &amp; Courses | ExcelVBATutor","og_description":"In Excel VBA, we can write decision-making codes based on certain conditions. There are two methods to write decision-making code in Excel VBA, using the If&#8230;..Then&#8230;Else syntax or using the Select Case&#8230;End select syntax. The syntaxes are exactly the same as VB6.\u00a0 You need to use both the conditional operators and the logical operators together &hellip; Continue reading \"Decision Making in Excel VBA\"","og_url":"https:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/","og_site_name":"Learn Excel VBA Online \u2013 Step-by-Step Tutorials &amp; Courses | ExcelVBATutor","article_published_time":"2017-09-15T04:34:13+00:00","article_modified_time":"2018-10-03T05:12:15+00:00","author":"Liew Voon Kiong","twitter_misc":{"Written by":"Liew Voon Kiong","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/#article","isPartOf":{"@id":"https:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/"},"author":{"name":"Liew Voon Kiong","@id":"https:\/\/excelvbatutor.com\/#\/schema\/person\/43d141df324e8eb01509c5f5d8a4a76a"},"headline":"Decision Making in Excel VBA","datePublished":"2017-09-15T04:34:13+00:00","dateModified":"2018-10-03T05:12:15+00:00","mainEntityOfPage":{"@id":"https:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/"},"wordCount":108,"keywords":["If statement"],"articleSection":["Decision making"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/","url":"https:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/","name":"Decision Making in Excel VBA - Learn Excel VBA Online \u2013 Step-by-Step Tutorials &amp; Courses | ExcelVBATutor","isPartOf":{"@id":"https:\/\/excelvbatutor.com\/#website"},"datePublished":"2017-09-15T04:34:13+00:00","dateModified":"2018-10-03T05:12:15+00:00","author":{"@id":"https:\/\/excelvbatutor.com\/#\/schema\/person\/43d141df324e8eb01509c5f5d8a4a76a"},"breadcrumb":{"@id":"https:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/excelvbatutor.com\/index.php\/2017\/09\/15\/decision-making-excel-vba\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/excelvbatutor.com\/"},{"@type":"ListItem","position":2,"name":"Decision Making in 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"},{"@type":"Person","@id":"https:\/\/excelvbatutor.com\/#\/schema\/person\/43d141df324e8eb01509c5f5d8a4a76a","name":"Liew Voon Kiong","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/excelvbatutor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3e3750a9c46828b988fc9432ec548bc847e79637d0971da3f409da2ec81297df?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3e3750a9c46828b988fc9432ec548bc847e79637d0971da3f409da2ec81297df?s=96&d=mm&r=g","caption":"Liew Voon Kiong"},"url":"https:\/\/excelvbatutor.com\/index.php\/author\/ajs7051vba\/"}]}},"_links":{"self":[{"href":"https:\/\/excelvbatutor.com\/index.php\/wp-json\/wp\/v2\/posts\/2716","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/excelvbatutor.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/excelvbatutor.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"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=2716"}],"version-history":[{"count":3,"href":"https:\/\/excelvbatutor.com\/index.php\/wp-json\/wp\/v2\/posts\/2716\/revisions"}],"predecessor-version":[{"id":3164,"href":"https:\/\/excelvbatutor.com\/index.php\/wp-json\/wp\/v2\/posts\/2716\/revisions\/3164"}],"wp:attachment":[{"href":"https:\/\/excelvbatutor.com\/index.php\/wp-json\/wp\/v2\/media?parent=2716"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelvbatutor.com\/index.php\/wp-json\/wp\/v2\/categories?post=2716"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelvbatutor.com\/index.php\/wp-json\/wp\/v2\/tags?post=2716"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}