VB脚本excel marco曾经可以工作,但现在不起作用

时间:2019-09-15 04:22:18

标签: excel vba

'Delete All transaction rows from spreadsheet containing "Cash" in Column N
    Dim c As Range
    Dim SrchRng
    Set SrchRng = ActiveSheet.Range("N1", ActiveSheet.Range("N999").End(xlUp))
    Do
        Set c = SrchRng.Find("Cash", LookIn:=xlValues)
            If Not c Is Nothing Then c.EntireRow.Delete
            Loop While Not c Is Nothing
'Delete All transaction rows from spreadsheet containing "Account Type" in Column N
    Set SrchRng = ActiveSheet.Range("N1", ActiveSheet.Range("N999").End(xlUp))
    Do
        Set c = SrchRng.Find("Account Type", LookIn:=xlValues)
            If Not c Is Nothing Then c.EntireRow.Delete
            Loop While Not c Is Nothing

设置c = SrchRng.Find("Cash", LookIn:=xlValues)行现在引起调试。数据看起来正确,因为N列中有包含Cash单词的行,应该删除整行。

0 个答案:

没有答案