{"id":131,"date":"2015-10-24T12:16:34","date_gmt":"2015-10-24T12:16:34","guid":{"rendered":"http:\/\/99excel.com\/?p=131"},"modified":"2021-05-14T16:09:21","modified_gmt":"2021-05-14T16:09:21","slug":"do-while","status":"publish","type":"post","link":"https:\/\/99excel.com\/home\/do-while\/","title":{"rendered":"Do While"},"content":{"rendered":"<p>This is very similar to ours <strong>Do<\/strong> Loop we just used above. The only difference is, instead of the condition we set (iMyNumber &lt; 1000) being checked <strong>AFTER<\/strong> the Do has run at least once, the Do While will check the condition <strong>BEFORE<\/strong> it runs. Let&#8217;s say our Variable iMyNumber has already had the Value 101 parsed to it. In the Do Loop we used above, it will NOT know the Value of iMyNumber until it has <strong>run ONCE<\/strong>. This would mean our Variable would come out of the <strong>Do<\/strong> Loop with a Value of 102. But in the <strong>Do While<\/strong> below, it would never even enter the Loop:-<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Sub My_DoWhile()<\/p>\n<p>Dim iMyNumber as Integer<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Do While<\/strong> iMyNumber &lt; 1000<\/p>\n<p>iMyNumber = 1 + iMyNumber<\/p>\n<p>Range(&#8220;b2&#8221;).Value = iMyNumber<\/p>\n<p><strong>Loop<\/strong><\/p>\n<p>End Sub<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is very similar to ours Do Loop we just used above. The only difference is, instead of the condition we set (iMyNumber &lt; 1000) being checked AFTER the Do has run at least once, the Do While will check the condition BEFORE it runs. Let&#8217;s say our Variable iMyNumber has already had the Value &#8230; <a title=\"Do While\" class=\"read-more\" href=\"https:\/\/99excel.com\/home\/do-while\/\" aria-label=\"More on Do While\">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-131","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\/131","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=131"}],"version-history":[{"count":1,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/posts\/131\/revisions"}],"predecessor-version":[{"id":891,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/posts\/131\/revisions\/891"}],"wp:attachment":[{"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/media?parent=131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/categories?post=131"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/tags?post=131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}