tropics123
Board Regular
- Joined
- May 11, 2016
- Messages
- 85
Hi, looking for some help to take this macro a step further. An illustration below but this is not exact because my sheet will vary with different number of rows daily.
What I'm trying to do: If column E is "0" then delete entire row but if column B has "RK003" then do not delete that row, even if column E has the value "0". My macro can only do the first half of what needs to be done but the second half (in orange font), I don't know how to do. I appreciate your help!
With ActiveSheet
.AutoFilterMode = False
With Range("E1", Range("E" & Rows.Count).End(xlUp))
.AutoFilter 1, "0"
On Error Resume Next
.Offset(1).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
End With
End Sub
<tbody>
</tbody>
What I'm trying to do: If column E is "0" then delete entire row but if column B has "RK003" then do not delete that row, even if column E has the value "0". My macro can only do the first half of what needs to be done but the second half (in orange font), I don't know how to do. I appreciate your help!
With ActiveSheet
.AutoFilterMode = False
With Range("E1", Range("E" & Rows.Count).End(xlUp))
.AutoFilter 1, "0"
On Error Resume Next
.Offset(1).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
End With
End Sub
column A | column B | column C | column D | Column E |
RK001 | 0 | |||
RK003 | 0 | |||
RK005 | 687 | |||
RK008 | 0 | |||
RK003 | 0 | |||
RK003 | 100 | |||
RK009 | 28 | |||
RK002 | 0 | |||
RK007 | 155,000 |
<tbody>
</tbody>