Hi,
I am looking to delete any row that contains a value above 0 in column I.
I have a code here but I cant seem to change the value looked for into a number.
Thanks,
Malav
I am looking to delete any row that contains a value above 0 in column I.
I have a code here but I cant seem to change the value looked for into a number.
VBA Code:
Sub Testdelete1()
Application.ScreenUpdating = False
Dim LastRow As Long
Dim c As Long
Dim s As Variant
c = 10
s = "Not Approved" '
LastRow = Cells(Rows.Count, c).End(xlUp).Row
With ActiveSheet.Cells(1, c).Resize(LastRow)
.AutoFilter 1, s
counter = .Columns(c).SpecialCells(xlCellTypeVisible).Count
If counter > 1 Then
.Offset(1).Resize(.Rows.Count - 1).SpecialCells(xlCellTypeVisible).EntireRow.Delete
Else
MsgBox "No values found"
End If
.AutoFilter
End With
Application.ScreenUpdating = True
End Sub
Thanks,
Malav
Last edited by a moderator: