I need to search for text in COL A of an excel file and find “MEAN” and put a page break after those instances. How can I turn the below recorded macro into a loop that search through the whole file? Thank you for the help.
Cells.Find(What:=”MEAN”, After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Rows(“21:21”).Select
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell
Selection.FindNext(After:=ActiveCell).Activate