我正在寻找可以删除行的VBA,如果B列中的单元格包含红色填充颜色。
感谢您的帮助!
答案 0 :(得分:1)
这使用特定的Red (ColorIndex#3)
Sub BetterDeadThanRed()
Dim N As Long
N = Cells(Rows.Count, "B").End(xlUp).Row
For i = N To 1 Step -1
If Cells(i, "B").Interior.ColorIndex = 3 Then
Cells(i, "B").EntireRow.Delete
End If
Next i
End Sub
注意强>
我们从下往上运行循环。
这个子不是很快。