Hi, sorry to thread hijack, but i am looking at doing a similar task, however it involves deleting some rows.
Firstly what i want the macro to do is to search the sheet, and when it finds the word "Termination" in Column B, it will delete all the rows above.
The word "Termination" can appear on different rows, depending on the size of the HTML import.
I tried to do this myself by amending Grichey's VBA script above, but when running, the debug catches an overflow error.
[VBA]
Option Explicit
Sub InsertAfterTotal()
Dim lastCell As Integer
Dim counter As Integer
lastCell = Range("A65536").End(xlDown).Row
counter = lastCell
Do
Range("B" & counter).Select
If Right(Trim(Selection), 5) = "Termination" Then
Rows(counter + 1).Insert Shift:=xlUp
End If
counter = counter - 1
Loop Until counter = 0
End Sub
[/VBA]
Thanks in advance for your help