+ Reply to Thread
Results 1 to 3 of 3

macro to insert row after specific text

  1. #1
    Luke
    Guest

    macro to insert row after specific text

    in column "A" I need to insert row after specific word, "First Out". is
    there a macro for this?
    I have over 7000 rows and one at a time is not good.
    Thank you
    Luke




  2. #2
    Bob Phillips
    Guest

    Re: macro to insert row after specific text

    Sub Test()
    Dim iLastRow As Long
    Dim i As Long

    iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
    For i = iLastRow To 1 Step -1
    If Cells(i, "A").Value = "First Out" Then
    Rows(i + 1).Insert
    End If
    Next i

    End Sub


    --
    HTH

    Bob Phillips

    "Luke" <[email protected]> wrote in message
    news:[email protected]...
    > in column "A" I need to insert row after specific word, "First Out". is
    > there a macro for this?
    > I have over 7000 rows and one at a time is not good.
    > Thank you
    > Luke
    >
    >
    >




  3. #3
    Luke
    Guest

    Re: macro to insert row after specific text

    Thank you Bob
    Luke

    "Bob Phillips" wrote:

    > Sub Test()
    > Dim iLastRow As Long
    > Dim i As Long
    >
    > iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
    > For i = iLastRow To 1 Step -1
    > If Cells(i, "A").Value = "First Out" Then
    > Rows(i + 1).Insert
    > End If
    > Next i
    >
    > End Sub
    >
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > "Luke" <[email protected]> wrote in message
    > news:[email protected]...
    > > in column "A" I need to insert row after specific word, "First Out". is
    > > there a macro for this?
    > > I have over 7000 rows and one at a time is not good.
    > > Thank you
    > > Luke
    > >
    > >
    > >

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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