{"id":5059,"date":"2021-11-12T10:07:51","date_gmt":"2021-11-12T10:07:51","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=5059"},"modified":"2021-11-12T10:11:04","modified_gmt":"2021-11-12T10:11:04","slug":"insert-rows-based-on-date-in-cells-vba","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/office\/insert-rows-based-on-date-in-cells-vba\/12326.html","title":{"rendered":"Insert Rows Based On Date In Cells Vba"},"content":{"rendered":"<p>hi,<\/p>\n<p>i have data like this:<\/p>\n<p>8\/24\/2010 p 15243<br \/>\n8\/24\/2010 p 1500<br \/>\n8\/29\/2010 n 45<br \/>\n8\/29\/2010 p 7410<br \/>\n8\/29\/2010 p 621<br \/>\n8\/29\/2010 n 275<br \/>\n9\/2\/2010 p 15243<br \/>\n9\/2\/2010 p 1500<\/p>\n<p>what I need excel to do is insert a row (blank) after every specific date (for e.g. between the last entry of 8\/24 and the first of 8\/29).<\/p>\n<p>any kind of code that I have written just does not seem to work..<\/p>\n<p>please HELP!!!<\/p>\n<p>Here&#8217;s the code<br \/>\n*************start****<br \/>\nSub testloop()<br \/>\nDim vdate As Date<\/p>\n<p>Range(&#8220;B9&#8221;).Select<br \/>\nDo<br \/>\nIf ActiveCell.Value &lt; CLng(vdate) Then<br \/>\n&#8216;do nothing<br \/>\nElse<br \/>\nActiveCell.EntireRow.Select<br \/>\nSelection.Insert Shift:=xlDown<br \/>\nActiveCell.Offset(1, 0).Select<br \/>\nEnd If<\/p>\n<p>Loop Until IsEmpty(ActiveCell.Offset(0, 1))<br \/>\nEnd Sub<br \/>\n************end\/****<\/p>\n<p>i know this is a bit wrong (a whole lot), but, I&#8217;m still trying to learn.. \ud83d\ude42<\/p>\n<p>Thanks..<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":35},"question-category":[53],"question_tags":[],"class_list":["post-5059","question","type-question","status-publish","hentry","question-category-office"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/5059","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=5059"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=5059"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=5059"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=5059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}