また、Find を使用した別の方法...
Sub TestDeleteRows()
Dim rFind As Range
Dim rDelete As Range
Dim strSearch As String
Dim sFirstAddress As String
strSearch = "DR"
Set rDelete = Nothing
Application.ScreenUpdating = False
With Sheet1.Columns("D:D")
Set rFind = .Find(strSearch, LookIn:=xlValues, LookAt:=xlPart, SearchDirection:=xlNext, MatchCase:=False)
If Not rFind Is Nothing Then
sFirstAddress = rFind.Address
Do
If rDelete Is Nothing Then
Set rDelete = rFind
Else
Set rDelete = Application.Union(rDelete, rFind)
End If
Set rFind = .FindNext(rFind)
Loop While Not rFind Is Nothing And rFind.Address <> sFirstAddress
rDelete.EntireRow.Delete
End If
End With
Application.ScreenUpdating = True
End Sub
以下の例は似ていますが、一番下から始まり、逆の順序で一番上に向かっています。一度にすべてではなく、一度に各行を削除します。
Sub TestDeleteRows()
Dim rFind As Range
Dim rDelete As Range
Dim strSearch As String
strSearch = "DR"
Set rDelete = Nothing
Application.ScreenUpdating = False
With Sheet1.Columns("D:D")
Set rFind = .Find(strSearch, LookIn:=xlValues, LookAt:=xlPart, SearchDirection:=xlPrevious, MatchCase:=False)
If Not rFind Is Nothing Then
Do
Set rDelete = rFind
Set rFind = .FindPrevious(rFind)
If rFind.Address = rDelete.Address Then Set rFind = Nothing
rDelete.EntireRow.Delete
Loop While Not rFind Is Nothing
End If
End With
Application.ScreenUpdating = True
End Sub