Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Insert date in macro | New Users to Excel | |||
can you find specific text in a string ignoring any other text | Excel Discussion (Misc queries) | |||
Insert text in a cell with a macro | Excel Discussion (Misc queries) | |||
Formulas dealing with text data | Excel Worksheet Functions | |||
Macro or Formula to remove Text from Cells | Excel Worksheet Functions |