+ Reply to Thread
Results 1 to 2 of 2

Thread: simple....need to insert new row after every other row.

  1. #1
    Registered User
    Join Date
    01-20-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2007
    Posts
    33

    simple....need to insert new row after every other row.

    I need to insert a new row after each row that begins with SPL in column A. In this sheet it happens to be every other row. But I do have a couple of other sheets where it isn't every other row.
    Attached Files Attached Files
    Last edited by lisach; 02-03-2012 at 08:54 PM.

  2. #2
    Valued Forum Contributor MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    5,275

    Re: simple....need to insert new row after every other row.

    Hi Iisach,
    Here is some code that will do what you want.
    Sub NewRowAfterSPL()
    Dim LastRow As Double
    LastRow = Cells(Rows.Count, "A").End(xlUp).Row
    Dim RowCtr As Double
        For RowCtr = 1 To LastRow
            If Left(Cells(RowCtr, "A"), 3) = "SPL" Then
                Rows(RowCtr + 1).Insert
                RowCtr = RowCtr + 1
            End If
        Next RowCtr
    End Sub
    One test is worth a thousand opinions.
    Click the * below to say thanks.

+ 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.2.0