The code below is designed to find the word "world", check if there is an empty line above it, if there is then an output from the macro, if not, then insert an empty line! Finally exhausted to look, well, what's wrong with this simple line? The macro itself inserts an empty string and re-follows it does not see it and again inserts a new empty string, and so on to infinity.
Sub Test() Cells.Find(What:="world", After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Activate ActiveCell.Offset(-1, 0).Select If IsEmpty(Rows(ActiveCell.Row).Select) = True Then End Else ActiveCell.Offset(1, 0).Select Selection.EntireRow.Insert Selection.Rows.AutoFit End If End Sub