M
Mikey
I created a simple Macro to Find and then delete certain rows.
Cells.Find(What:="Page", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Delete Shift:=xlUp
End Sub
I them wanted to make this macro loop through the column until all instances
of Page were deleted. So I added Do Until ActiveCell.Value = " " at the
beginning and Loop before the End Sub. It removed all the rows but a run-time
error '91' appeared that stated Object variable or with block variable not
set. How do I correct my loop statement to run correctly?
Cells.Find(What:="Page", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Delete Shift:=xlUp
End Sub
I them wanted to make this macro loop through the column until all instances
of Page were deleted. So I added Do Until ActiveCell.Value = " " at the
beginning and Loop before the End Sub. It removed all the rows but a run-time
error '91' appeared that stated Object variable or with block variable not
set. How do I correct my loop statement to run correctly?