'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单词的行,应该删除整行。