VBA 删除有颜色的行
程序员文章站
2022-05-16 09:28:48
...
Dim lecNum As Integer
Dim lecturelastRow As Integer
lecturelastRow = ActiveWorkbook.Sheets("sheeet1").UsedRange.Rows.Count
For lecNum = 0 To lecturelastRow
'将第二列是红色的行删除
If Cells(lecNum, 2).Interior.ColorIndex = 3 Then
Rows(lecNum).Delete shift:=xlUp
Exit For
End If
Next
上一篇: VBA学习(四)函数
下一篇: VBA学习记录