I can perform a delete row based on a value if it is 0 or greater, but how would I modify something such as this
Public Sub delete_row()
Dim i
Range("A1").Select
For i = 1 To Range("A1", Cells(Rows.Count, 1).End(xlUp)).Rows.Count
If ActiveCell.Offset(i, 0) = False Then
If ActiveCell.Offset(i, 0) = "" Then Exit For
ActiveCell.Offset(i, 0).EntireRow.Delete
i = i - 1
End If
Next i
End Sub
so that cells that begin with BRNG-XXXX-XXXXXX the whole row is deleted? I tried just inserting
Option Explicit
Public Sub deleted_row()
Dim i
Range("C2").Select
For i = 1 To Range("C2", Cells(Rows.Count, 1).End(xlUp)).Rows.Count
'put your value you want after the = sign to achieve your objective. (0)
If ActiveCell.Offset(i, "BRNG") = True Then
If ActiveCell.Offset(i, 0) = "" Then Exit For
ActiveCell.Offset(i, 0).EntireRow.Delete
i = i - 1
End If
Next i
End Sub
"BRNG" but i get
Run-time error '13": Type Mismatch
Bookmarks