增村保造豆瓣:Excel VBA 删除EXCEL 2个字符串所在行之间的行,已解决,感谢版主 - Exc...

来源:百度文库 编辑:偶看新闻 时间:2024/04/28 23:11:15
Sub DelRow()
    Dim c As Range, d As Range
    Application.ScreenUpdating = False
    With Sheet1.[a:a]
        Do
            Set c = .Find("Wake Up Call", , , 1)
            If Not c Is Nothing Then
                Set d = .Find("END", , , 1)
                If Not d Is Nothing Then
                    Rows(c.Row & ":" & d.Row).Delete
                End If
            End If
        Loop Until .Find("Wake Up Call", , , 1) Is Nothing Or .Find("END", , , 1) Is Nothing
    End With
End Sub