{"id":76,"date":"2010-12-09T10:04:21","date_gmt":"2010-12-09T09:04:21","guid":{"rendered":"http:\/\/mariaevert.dk\/vba\/?p=76"},"modified":"2010-12-09T10:11:35","modified_gmt":"2010-12-09T09:11:35","slug":"vba-loop-thorugh-arrays","status":"publish","type":"post","link":"https:\/\/mariaevert.dk\/vba\/?p=76","title":{"rendered":"VBA &#8211; Loop through arrays"},"content":{"rendered":"<p>This post shows how to define an array, and to loop through each of the items in it. So many more things can be done with arrays (resizing, adding, deleting items, etc.) but for now I&#8217;ll just show how to loop through them.. that&#8217;s always useful.<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n\r\nDim myArray As Variant\r\nDim x As Integer\r\n\r\nmyArray = Array(34610, 92105, 92263, 94121) 'define array\r\n\r\nFor x = LBound(myArray) To UBound(myArray) 'define start and end of array\r\n\r\nMsgBox (myArray(x))\r\n\r\nNext x ' Loop!\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This post shows how to define an array, and to loop through each of the items in it. So many more things can be done with arrays (resizing, adding, deleting items, etc.) but for now I&#8217;ll just show how to loop through them.. that&#8217;s always useful.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,5],"tags":[],"_links":{"self":[{"href":"https:\/\/mariaevert.dk\/vba\/index.php?rest_route=\/wp\/v2\/posts\/76"}],"collection":[{"href":"https:\/\/mariaevert.dk\/vba\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mariaevert.dk\/vba\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mariaevert.dk\/vba\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mariaevert.dk\/vba\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=76"}],"version-history":[{"count":4,"href":"https:\/\/mariaevert.dk\/vba\/index.php?rest_route=\/wp\/v2\/posts\/76\/revisions"}],"predecessor-version":[{"id":80,"href":"https:\/\/mariaevert.dk\/vba\/index.php?rest_route=\/wp\/v2\/posts\/76\/revisions\/80"}],"wp:attachment":[{"href":"https:\/\/mariaevert.dk\/vba\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=76"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mariaevert.dk\/vba\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=76"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mariaevert.dk\/vba\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=76"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}