{"id":1191,"date":"2012-01-12T19:09:28","date_gmt":"2012-01-12T19:09:28","guid":{"rendered":"http:\/\/www.learnexcelmacro.com\/?p=1191"},"modified":"2017-07-11T20:50:07","modified_gmt":"2017-07-11T20:50:07","slug":"for-loop-excel-macro","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/","title":{"rendered":"Excel Macro Tutorial : For Next Loop in Excel Macro"},"content":{"rendered":"<p>[fullwidth background_color=&#8221;&#8221; background_image=&#8221;&#8221; background_parallax=&#8221;none&#8221; enable_mobile=&#8221;no&#8221; parallax_speed=&#8221;0.3&#8243; background_repeat=&#8221;no-repeat&#8221; background_position=&#8221;left top&#8221; video_url=&#8221;&#8221; video_aspect_ratio=&#8221;16:9&#8243; video_webm=&#8221;&#8221; video_mp4=&#8221;&#8221; video_ogv=&#8221;&#8221; video_preview_image=&#8221;&#8221; overlay_color=&#8221;&#8221; overlay_opacity=&#8221;0.5&#8243; video_mute=&#8221;yes&#8221; video_loop=&#8221;yes&#8221; fade=&#8221;no&#8221; border_size=&#8221;0px&#8221; border_color=&#8221;&#8221; border_style=&#8221;&#8221; padding_top=&#8221;20&#8243; padding_bottom=&#8221;20&#8243; padding_left=&#8221;&#8221; padding_right=&#8221;&#8221; hundred_percent=&#8221;no&#8221; equal_height_columns=&#8221;no&#8221; hide_on_mobile=&#8221;no&#8221; menu_anchor=&#8221;&#8221; class=&#8221;&#8221; id=&#8221;&#8221;][one_full last=&#8221;yes&#8221; spacing=&#8221;yes&#8221; center_content=&#8221;no&#8221; hide_on_mobile=&#8221;no&#8221; background_color=&#8221;&#8221; background_image=&#8221;&#8221; background_repeat=&#8221;no-repeat&#8221; background_position=&#8221;left top&#8221; hover_type=&#8221;none&#8221; link=&#8221;&#8221; border_position=&#8221;all&#8221; border_size=&#8221;0px&#8221; border_color=&#8221;&#8221; border_style=&#8221;&#8221; padding=&#8221;&#8221; margin_top=&#8221;&#8221; margin_bottom=&#8221;&#8221; animation_type=&#8221;&#8221; animation_direction=&#8221;&#8221; animation_speed=&#8221;0.1&#8243; animation_offset=&#8221;&#8221; class=&#8221;&#8221; id=&#8221;&#8221;][title size=&#8221;1&#8243; content_align=&#8221;left&#8221; style_type=&#8221;underline solid&#8221; sep_color=&#8221;&#8221; margin_top=&#8221;&#8221; margin_bottom=&#8221;&#8221; class=&#8221;&#8221; id=&#8221;&#8221;]Beginners guide for how to use\u00a0FOR Loop in Excel VBA[\/title][fusion_text]Keeping the beginners in mind, I am going to write this article about <strong>For Next loop<\/strong> in Excel Macro. Also one of my friend wanted such post to be published. First of all i would like to thank for such input and feedback. Even if you want any help or any article to be published, <a href=\"https:\/\/vmlogger.com\/excel\/ask-us\/\" target=\"_blank\"><strong>kindly mail me.<\/strong><\/a><\/p>\n<p>If you want to learn Excel Macros then read articles from <strong><a href=\"https:\/\/vmlogger.com\/excel\/excel-macro-tutorial\/\" target=\"_blank\">Excel Macro Tutorial<\/a><\/strong><\/p>\n<p>So coming to the Article, mainly there are following Types of Loops which are used.<\/p>\n<ul>\n<li><a href=\"https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop\/#for-loop\">For Next Loop<\/a><\/li>\n<li><a href=\"https:\/\/vmlogger.com\/excel\/2012\/01\/while-loop-in-excel-vba\/\" target=\"_blank\">While Loop<\/a><\/li>\n<li><a href=\"https:\/\/vmlogger.com\/excel\/2012\/01\/while-loop-in-excel-vba\/\" target=\"_blank\">Do While Loop<\/a><\/li>\n<\/ul>\n<p>In this Article, I am going to Explain you about For Next Loop. For Other Two loops <strong>While and Do While Loop<\/strong>, you can refer the <strong><a href=\"https:\/\/vmlogger.com\/excel\/2012\/01\/while-loop-in-excel-vba\/\" target=\"_blank\">next article.<\/a><\/strong><\/p>\n<p><a name=\"for-loop\"><\/a><br \/>\n[\/fusion_text][\/one_full][title size=&#8221;1&#8243; content_align=&#8221;left&#8221; style_type=&#8221;underline solid&#8221; sep_color=&#8221;&#8221; margin_top=&#8221;&#8221; margin_bottom=&#8221;&#8221; class=&#8221;&#8221; id=&#8221;&#8221;]How to use FOR Loop in Excel VBA[\/title][fusion_text]In this Article you will learn about <strong>For Next loop.<\/strong> This is the most frequently used loop. It enables you to execute a set of VBA statements multiple number of iterations.<\/p>\n<p>Since it is a loop, it requires<\/p>\n<p>1. An Index or Incremental variable which counts the total number of iterations after completion of each iteration..<\/p>\n<p>2. Such a condition where this loop should end.<\/p>\n<p><em><strong>Note:<\/strong> Be careful with this condition. If it is such a condition which may never end, then it is infinite loop and your program will crash.<br \/>\n<\/em>[\/fusion_text][title size=&#8221;2&#8243; content_align=&#8221;left&#8221; style_type=&#8221;underline solid&#8221; sep_color=&#8221;&#8221; margin_top=&#8221;&#8221; margin_bottom=&#8221;&#8221; class=&#8221;&#8221; id=&#8221;&#8221;]FOR LOOP Syntax in Excel VBA[\/title][fusion_text]<\/p>\n<table width=\"100%\" bgcolor=\"#FCF9BF\">\n<tbody>\n<tr>\n<td>For index=start to end<br \/>\n[statements]<br \/>\n&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<br \/>\n&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<br \/>\n&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<br \/>\nNext<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Example:<\/strong>Now let&#8217;s take an example to understand how exactly this for loop works. Suppose you need to calculate the Sum of first 10 Numbers from 1 to 10.<\/p>\n<pre class=\"VB\">Sum = 0\r\nFor iCount = 1 To 10\r\nSum = Sum + iCount\r\nNext\r\nMsgBox Sum\r\n\r\n<\/code><\/pre>\n<p><strong>Explanation:<\/strong> In the above example Variable &#8220;i&#8221; is the index variable which is set to 1 from Start. So in the first iteration the Value of i is 1. Control will go inside the loop and execute the statement like &#8220;Sum=Sum + iCount&#8221;. When it reaches to &#8220;Next&#8221; then by default it will increase the value if i by 1. So for the next iteration the value of &#8220;iCount&#8221; will be 1+1=2.<br \/>\nEvery time before getting in to the loop, one condition (i&lt;=10) will be checked. This condition is not specifically mentioned in the above code, but this is the For Loop property. Loop will keep going until the value of &#8220;i&#8221; reaches to 10.<br \/>\nWhen the value of i reached to 11 then the Condition (iCount&lt;=10) is failed and then control will come out of the For Loop and loop will be ended.[\/fusion_text][\/fullwidth][title size=&#8221;1&#8243; content_align=&#8221;left&#8221; style_type=&#8221;underline&#8221; sep_color=&#8221;&#8221; margin_top=&#8221;&#8221; margin_bottom=&#8221;&#8221; class=&#8221;&#8221; id=&#8221;&#8221;]How to Exit from For Loop in Excel VBA[\/title][fusion_text]Now as you can see, in the above example, For..Loop will run for 10 times and then only it will exit from the loop. Sometimes when you want to exit from the loop even before the FOR condition is failed. Using\u00a0<em><strong>Exit For <\/strong><\/em>one can terminate the for loop any given point of time.<\/p>\n<pre class=\"VB\">Sum = 0\r\nFor iCount = 1 To 10\r\nSum = Sum + iCount\r\nIf Sum &gt; 30 Then Exit For\r\nNext\r\nMsgBox Sum\r\n\r\n<\/code><\/pre>\n<p>In the above example as soon as the Value of Sum is greater than 30 then Loop will be terminated though the value of &#8220;iCount&#8221; is still less than 10.<\/p>\n<p>[\/fusion_text][title size=&#8221;1&#8243; content_align=&#8221;left&#8221; style_type=&#8221;underline&#8221; sep_color=&#8221;&#8221; margin_top=&#8221;&#8221; margin_bottom=&#8221;&#8221; class=&#8221;&#8221; id=&#8221;&#8221;]What is For Loop with Step[\/title][fusion_text]So far you see that every time For Loop index is incremented by 1. <em><strong>So what if you want to increase the index by 2, 3, etc. each time?<\/strong><\/em><\/p>\n<p>It&#8217;s simple, here is the syntax to use <em><strong>STEP keyword in FOR NEXT Loop <\/strong><\/em>in excel VBA.<\/p>\n<p><strong>Syntax<\/strong><\/p>\n<table width=\"100%\" bgcolor=\"#FCF9BF\">\n<tbody>\n<tr>\n<td>For [index=start] to [end] <strong>Step<\/strong> [interval]<br \/>\n[statements]<br \/>\n&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<br \/>\n&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<br \/>\n&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<br \/>\nNext<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Example:<\/strong>In the below example in each iteration the Value of i will be incremented by 2, instead of 1. If we don&#8217;t mention <strong>Step [interval]<\/strong> then by default it increases by 1.<\/p>\n<pre class=\"VB\">Sum = 0\r\nFor iCount = 1 To 10 <strong>Step<\/strong> 2\r\nSum = Sum + iCount\r\nNext\r\nMsgBox Sum\r\n<\/code><\/pre>\n<p>[\/fusion_text][title size=&#8221;1&#8243; content_align=&#8221;left&#8221; style_type=&#8221;underline&#8221; sep_color=&#8221;&#8221; margin_top=&#8221;&#8221; margin_bottom=&#8221;&#8221; class=&#8221;&#8221; id=&#8221;&#8221;]For Loop in Descending Order[\/title][fusion_text]Sometimes you need to Run your For..Next Loop from a bigger value to a smaller value. It means in every iteration, you want to decrease the Value of &#8220;iCount&#8221; by a specific interval.<\/p>\n<p>Now as you know how to set interval for each iteration in your For Next Loop using <em><strong>STEP keyword, all you need to set to interval to a negative value.<\/strong><\/em> This way after every iteration your For Next Loop iteration value will be decreased by specified interval.<\/p>\n<p><strong>Example:<\/strong>Now let&#8217;s take an example to understand how exactly this for loop works. Suppose you need to calculate the Sum of first 10 Numbers from 1 to 10.<\/p>\n<pre class=\"VB\">Sum = 0\r\nFor iCount = 10 To 1 Step -1\r\nSum = Sum + iCount\r\nNext\r\nMsgBox Sum\r\n\r\n<\/code><\/pre>\n<p>In the above example, &#8220;iCount&#8221; value will start from 10 and it will be decreased by 1 every time <em><strong>because the interval value is set to -1.<\/strong><\/em><\/p>\n<table width=\"100%\" bgcolor=\"#FCF9BF\">\n<tbody>\n<tr>\n<td><strong>In the Next Article, you learn about While and Do-While Loop.<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/vmlogger.com\/excel\/2012\/01\/while-loop-in-excel-vba\/\">While Loop<\/a><\/li>\n<li><a href=\"https:\/\/vmlogger.com\/excel\/2012\/01\/while-loop-in-excel-vba\/\">Do&#8230;While Loop<\/a><\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table width=\"100%\" bgcolor=\"#EBDDE2\">\n<tbody>\n<tr>\n<td>To Check out more Excel Macro Tutorials, visit <strong><a href=\"https:\/\/vmlogger.com\/excel\/excel-macro-tutorial\/\" target=\"_blank\">Excel Macro Tutorial<\/a><\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>[\/fusion_text]<\/p>\n<span class=\"et_bloom_bottom_trigger\"><\/span>","protected":false},"excerpt":{"rendered":"<p>[fullwidth background_color=&#8221;&#8221; background_image=&#8221;&#8221; background_parallax=&#8221;none&#8221; enable_mobile=&#8221;no&#8221; parallax_speed=&#8221;0.3&#8243; background_repeat=&#8221;no-repeat&#8221; background_position=&#8221;left top&#8221; video_url=&#8221;&#8221; video_aspect_ratio=&#8221;16:9&#8243; video_webm=&#8221;&#8221; video_mp4=&#8221;&#8221; video_ogv=&#8221;&#8221; video_preview_image=&#8221;&#8221; overlay_color=&#8221;&#8221; overlay_opacity=&#8221;0.5&#8243; video_mute=&#8221;yes&#8221; video_loop=&#8221;yes&#8221; fade=&#8221;no&#8221; border_size=&#8221;0px&#8221; border_color=&#8221;&#8221; border_style=&#8221;&#8221; padding_top=&#8221;20&#8243; padding_bottom=&#8221;20&#8243; padding_left=&#8221;&#8221; padding_right=&#8221;&#8221; hundred_percent=&#8221;no&#8221; equal_height_columns=&#8221;no&#8221; hide_on_mobile=&#8221;no&#8221; menu_anchor=&#8221;&#8221; class=&#8221;&#8221; id=&#8221;&#8221;][one_full last=&#8221;yes&#8221; spacing=&#8221;yes&#8221; center_content=&#8221;no&#8221; hide_on_mobile=&#8221;no&#8221; background_color=&#8221;&#8221; background_image=&#8221;&#8221; background_repeat=&#8221;no-repeat&#8221; background_position=&#8221;left top&#8221; hover_type=&#8221;none&#8221; link=&#8221;&#8221; border_position=&#8221;all&#8221; border_size=&#8221;0px&#8221; border_color=&#8221;&#8221; border_style=&#8221;&#8221; padding=&#8221;&#8221; margin_top=&#8221;&#8221; margin_bottom=&#8221;&#8221; animation_type=&#8221;&#8221; animation_direction=&#8221;&#8221; animation_speed=&#8221;0.1&#8243; animation_offset=&#8221;&#8221; [&hellip;]<\/p>\n","protected":false},"author":45,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","rop_custom_images_group":[],"rop_custom_messages_group":[],"rop_publish_now":"initial","rop_publish_now_accounts":{"facebook_10221221723514640_204908552914904":"","twitter_aTo1MTIwNTUyMDQ7_512055204":""},"rop_publish_now_history":[],"rop_publish_now_status":"pending","footnotes":""},"categories":[1675],"tags":[],"class_list":["post-1191","post","type-post","status-publish","format-standard","hentry","category-excel-macro-for-beginners"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v23.5 (Yoast SEO v23.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Tutorial for Beginners - How to Use For Loop in Excel VBA - LearnExcelMacro.com<\/title>\n<meta name=\"description\" content=\"A beginners guide - how to use For Loop in Excel Macro. Learn all possible ways to use For Loop in Excel VBA with Examples. For loop with negative increment\" \/>\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\/2012\/01\/for-loop-excel-macro\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Excel Macro Tutorial : For Next Loop in Excel Macro\" \/>\n<meta property=\"og:description\" content=\"A beginners guide - how to use For Loop in Excel Macro. Learn all possible ways to use For Loop in Excel VBA with Examples. For loop with negative increment\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/\" \/>\n<meta property=\"og:site_name\" content=\"Let&#039;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=\"2012-01-12T19:09:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-07-11T20:50:07+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=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/\"},\"author\":{\"name\":\"Vishwamitra Mishra\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"headline\":\"Excel Macro Tutorial : For Next Loop in Excel Macro\",\"datePublished\":\"2012-01-12T19:09:28+00:00\",\"dateModified\":\"2017-07-11T20:50:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/\"},\"wordCount\":1029,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"articleSection\":[\"Excel Macro Tutorial\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/\",\"url\":\"https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/\",\"name\":\"Tutorial for Beginners - How to Use For Loop in Excel VBA - LearnExcelMacro.com\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\"},\"datePublished\":\"2012-01-12T19:09:28+00:00\",\"dateModified\":\"2017-07-11T20:50:07+00:00\",\"description\":\"A beginners guide - how to use For Loop in Excel Macro. Learn all possible ways to use For Loop in Excel VBA with Examples. For loop with negative increment\",\"breadcrumb\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/vmlogger.com\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Excel Macro Tutorial\",\"item\":\"https:\/\/vmlogger.com\/excel\/excel-macro-for-beginners\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Excel Macro Tutorial : For Next Loop in Excel Macro\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\",\"url\":\"https:\/\/vmlogger.com\/excel\/\",\"name\":\"Let&#039;s excel in Excel\",\"description\":\"Let&#039;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 &amp; 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":"Tutorial for Beginners - How to Use For Loop in Excel VBA - LearnExcelMacro.com","description":"A beginners guide - how to use For Loop in Excel Macro. Learn all possible ways to use For Loop in Excel VBA with Examples. For loop with negative increment","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\/2012\/01\/for-loop-excel-macro\/","og_locale":"en_US","og_type":"article","og_title":"Excel Macro Tutorial : For Next Loop in Excel Macro","og_description":"A beginners guide - how to use For Loop in Excel Macro. Learn all possible ways to use For Loop in Excel VBA with Examples. For loop with negative increment","og_url":"https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/","og_site_name":"Let&#039;s excel in Excel","article_publisher":"http:\/\/www.facebook.com\/vmlogger","article_author":"http:\/\/www.facebook.com\/vmlogger","article_published_time":"2012-01-12T19:09:28+00:00","article_modified_time":"2017-07-11T20:50:07+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":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/#article","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/"},"author":{"name":"Vishwamitra Mishra","@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"headline":"Excel Macro Tutorial : For Next Loop in Excel Macro","datePublished":"2012-01-12T19:09:28+00:00","dateModified":"2017-07-11T20:50:07+00:00","mainEntityOfPage":{"@id":"https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/"},"wordCount":1029,"commentCount":1,"publisher":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"articleSection":["Excel Macro Tutorial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/","url":"https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/","name":"Tutorial for Beginners - How to Use For Loop in Excel VBA - LearnExcelMacro.com","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/#website"},"datePublished":"2012-01-12T19:09:28+00:00","dateModified":"2017-07-11T20:50:07+00:00","description":"A beginners guide - how to use For Loop in Excel Macro. Learn all possible ways to use For Loop in Excel VBA with Examples. For loop with negative increment","breadcrumb":{"@id":"https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/vmlogger.com\/excel\/2012\/01\/for-loop-excel-macro\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vmlogger.com\/excel\/"},{"@type":"ListItem","position":2,"name":"Excel Macro Tutorial","item":"https:\/\/vmlogger.com\/excel\/excel-macro-for-beginners\/"},{"@type":"ListItem","position":3,"name":"Excel Macro Tutorial : For Next Loop in Excel Macro"}]},{"@type":"WebSite","@id":"https:\/\/vmlogger.com\/excel\/#website","url":"https:\/\/vmlogger.com\/excel\/","name":"Let&#039;s excel in Excel","description":"Let&#039;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 &amp; 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\/1191"}],"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=1191"}],"version-history":[{"count":0,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts\/1191\/revisions"}],"wp:attachment":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/media?parent=1191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/categories?post=1191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/tags?post=1191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}