PERFICT IT IS WORKING VERY GOOD
THANKS ASHISH KOUL From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com] On Behalf Of ashish koul Sent: Thursday, February 24, 2011 8:47 AM To: excel-macros@googlegroups.com Subject: Re: $$Excel-Macros$$ Insert Row after Change in Value in a Selection @omar - try this Sub InsertRowChange() Dim i, j, k, z As Long k = Range("a65356").End(xlUp).Row Debug.Print k For i = k To 2 Step -1 If Not IsEmpty(Cells(i, 1)) And Not IsEmpty(Cells(i - 1, 1)) Then If Cells(i, 1).Text <> Cells(i - 1, 1).Text Then Range("a" & i).Select Selection.EntireRow.Insert ActiveCell.Offset(-1, 0).Select End If End If Next i Cells(1, 1).Select End Sub On Wed, Feb 23, 2011 at 9:23 PM, Jacob <app...@gmail.com> wrote: This is what I ended up using. Take in mind I was looking in column B. Work great. Thanks for all your help and suggestions and getting back so fast. Sub InsertRowChange() Dim i, j, k, z As Long k = Range("b65356").End(xlUp).Row Debug.Print k For i = k To 2 Step -1 If Cells(i, 2).Text <> Cells(i - 1, 2).Text Then Range("b" & i).Select Selection.EntireRow.Insert ActiveCell.Offset(-1, 0).Select End If Next i Cells(1, 1).Select End Sub -- ---------------------------------------------------------------------------- ------ Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com <http://www.excel-macros.blogspot.com/> 4. Learn VBA Macros at http://www.quickvba.blogspot.com <http://www.quickvba.blogspot.com/> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com <http://exceldailytip.blogspot.com/> To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel -- Regards Ashish Koul <http://akoul.blogspot.com/> akoul.blogspot.com <http://akoul.wordpress.com/> akoul.wordpress.com My Linkedin Profile <http://in.linkedin.com/pub/ashish-koul/10/400/830> P Before printing, think about the environment. -- ---------------------------------------------------------------------------- ------ Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel