Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Luke
 
Posts: n/a
Default 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   Report Post  
Bob Phillips
 
Posts: n/a
Default

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" wrote in message
...
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   Report Post  
Luke
 
Posts: n/a
Default

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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert date in macro George Gee New Users to Excel 12 April 17th 06 05:44 AM
can you find specific text in a string ignoring any other text chriscp Excel Discussion (Misc queries) 1 September 18th 05 09:54 PM
Insert text in a cell with a macro kayabob Excel Discussion (Misc queries) 5 June 22nd 05 05:43 PM
Formulas dealing with text data Bagia Excel Worksheet Functions 6 June 20th 05 10:29 PM
Macro or Formula to remove Text from Cells smck Excel Worksheet Functions 6 May 11th 05 03:22 AM


All times are GMT +1. The time now is 06:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"