I am trying to run a ‘Do Until’ loop in my macro that will search for a word, if its found, select the whole row containing that word, delete it, find the next and repeat. So far I have:</SPAN></SPAN>
Do</SPAN></SPAN>
Cells.Find(What:="Find_Word", After:=ActiveCell, LookIn:=xlFormulas, _</SPAN></SPAN>
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _</SPAN></SPAN>
MatchCase:=False, SearchFormat:=False).Activate</SPAN></SPAN>
ActiveCell.Rows("1:1").EntireRow.Select</SPAN></SPAN>
ActiveCell.Activate</SPAN></SPAN>
Selection.Delete Shift:=xlUp</SPAN></SPAN>
ActiveCell.Offset(-1, 0).Select</SPAN></SPAN>
Loop</SPAN></SPAN>
It deletes the rows I want, but just gives me a ‘Run-time error’ once all of the rows have been deleted and when I try to add 'Do Until', or 'Loop Until', it doesn’t work…. </SPAN></SPAN>
I also don’t know what I would add as the 'Loop until'=(cant find the word??)</SPAN></SPAN>
Any suggestions?</SPAN></SPAN>
Do</SPAN></SPAN>
Cells.Find(What:="Find_Word", After:=ActiveCell, LookIn:=xlFormulas, _</SPAN></SPAN>
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _</SPAN></SPAN>
MatchCase:=False, SearchFormat:=False).Activate</SPAN></SPAN>
ActiveCell.Rows("1:1").EntireRow.Select</SPAN></SPAN>
ActiveCell.Activate</SPAN></SPAN>
Selection.Delete Shift:=xlUp</SPAN></SPAN>
ActiveCell.Offset(-1, 0).Select</SPAN></SPAN>
Loop</SPAN></SPAN>
It deletes the rows I want, but just gives me a ‘Run-time error’ once all of the rows have been deleted and when I try to add 'Do Until', or 'Loop Until', it doesn’t work…. </SPAN></SPAN>
I also don’t know what I would add as the 'Loop until'=(cant find the word??)</SPAN></SPAN>
Any suggestions?</SPAN></SPAN>