{"id":123,"date":"2015-10-24T12:14:27","date_gmt":"2015-10-24T12:14:27","guid":{"rendered":"http:\/\/99excel.com\/?p=123"},"modified":"2021-05-14T16:09:21","modified_gmt":"2021-05-14T16:09:21","slug":"conditional-statement-if-then-else-statement","status":"publish","type":"post","link":"https:\/\/99excel.com\/home\/conditional-statement-if-then-else-statement\/","title":{"rendered":"Conditional Statement If&#8230;Then&#8230;Else Statement"},"content":{"rendered":"<p><strong>If&#8230;Then&#8230;Else Statement<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Conditionally executes a group of statements, depending on the value of an expression.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Syntax Format:<\/strong><\/p>\n<p><strong>If<\/strong> <em>condition<\/em> <strong>Then<\/strong> <em>[statements]<\/em> <strong>Else<\/strong> <em>[statements]<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Or, you can use the block form syntax:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>If <\/strong><em>condition<\/em> <strong>Then<\/strong><\/p>\n<p>[Statement]<\/p>\n<p><strong>ElseIf<\/strong> <em>condition<\/em> <strong>Then<\/strong><\/p>\n<p>[Statement]<\/p>\n<p><strong>ElseIf<\/strong> <em>condition<\/em> <strong>Then<\/strong><\/p>\n<p>[Statement]<\/p>\n<p><strong>ElseIf<\/strong> <em>condition<\/em> <strong>Then<\/strong><\/p>\n<p>[Statement]<\/p>\n<p><strong>.\u00a0 .\u00a0 .\u00a0 .\u00a0 .\u00a0 . <\/strong><\/p>\n<p><strong>Else: End If<\/strong><\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<p>Sub My_IF()<\/p>\n<p>Dim MyNumber, A, B, C<\/p>\n<p>MyNumber = Range(&#8220;B2&#8221;).Value<\/p>\n<p>A = 1<\/p>\n<p>B = 2<\/p>\n<p>C = 3<\/p>\n<p><strong>If <\/strong>MyNumber &lt; 10 <strong>Then<\/strong> A = A + MyNumber: B = B + A: C = C + B<\/p>\n<p>Range(&#8220;B2&#8221;).Value = C<\/p>\n<p>MsgBox (&#8220;Your value is:\u00a0 &#8221; &amp; C)<\/p>\n<p>End Sub<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If&#8230;Then&#8230;Else Statement &nbsp; Conditionally executes a group of statements, depending on the value of an expression. &nbsp; Syntax Format: If condition Then [statements] Else [statements] &nbsp; Or, you can use the block form syntax: &nbsp; If condition Then [Statement] ElseIf condition Then [Statement] ElseIf condition Then [Statement] ElseIf condition Then [Statement] .\u00a0 .\u00a0 .\u00a0 .\u00a0 &#8230; <a title=\"Conditional Statement If&#8230;Then&#8230;Else Statement\" class=\"read-more\" href=\"https:\/\/99excel.com\/home\/conditional-statement-if-then-else-statement\/\" aria-label=\"More on Conditional Statement If&#8230;Then&#8230;Else Statement\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-123","post","type-post","status-publish","format-standard","hentry"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/posts\/123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/comments?post=123"}],"version-history":[{"count":1,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/posts\/123\/revisions"}],"predecessor-version":[{"id":895,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/posts\/123\/revisions\/895"}],"wp:attachment":[{"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/media?parent=123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/categories?post=123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/tags?post=123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}