【发布时间】:2018-07-26 16:12:47
【问题描述】:
我希望使用此代码,但已对其进行了修改,以便它找到包含 Abuse Neglect (如部分匹配)字样的任何单元格 - 然后删除该行。任何帮助表示赞赏!
Sub TakeOutAllOtherCourses()
Last = Cells(Rows.Count, "D").End(xlUp).Row
For i = Last To 1 Step -1
If (Cells(i, "D").Value) = "Abuse Neglect" Then
'Cells(i, "A").EntireRow.ClearContents ' USE THIS TO CLEAR CONTENTS BUT NOT DELETE ROW
Cells(i, "A").EntireRow.Delete
End If
Next i
【问题讨论】:
-
肯定有如何做到这一点的例子:stackoverflow.com/questions/37208261/… - 等等。
-
你的意思是匹配“Abuse”或“Neglect”,还是匹配“Abuse Neglect”?