+ Reply to Thread
Results 1 to 3 of 3

Insert Row at Column value change and...

  1. #1
    Registered User
    Join Date
    08-16-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    16

    Insert Row at Column value change and...

    I am trying to add a row if the column value changes BUT I don't want to add the row if there is a blank row already between them. This is what column F looks like:

    600015

    638077
    638077
    638077
    638077

    620002
    638002

    600177
    600177
    600187
    620017
    700032

    I want it to add rows only between values 620002,638002,600177,600187,620017 and 700032.

    The script that I'm currently using adds an extra row between the others.
    Dim lRow As Long
    For lRow = Cells(Cells.rows.Count, "F").End(xlUp).Row To 2 Step -1
    If Cells(lRow, "F") <> Cells(lRow - 1, "F") Then rows(lRow).EntireRow.Insert
    Next lRow

    I think the solution is simple, I'm just missing it. Please help. THANK YOU!!

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Insert Row at Column value change and...

    Try this...

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 11-06-2012 at 05:53 PM.

  3. #3
    Registered User
    Join Date
    08-16-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Insert Row at Column value change and...

    I works perfectly! Thank you thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1