Hi all,
First and foremost happy holidays and thank you</SPAN></SPAN> for any help provided. I have copied a code from internet and I would like to modify it but dont know how ?
In the code below: it deletes the entire row rows based on the criteria different "RVWD" .
I would to modify it so deleted Rows different "RVWD","NEW","APRV".
Dim bUnion As Boolean
Dim i As Long, lastrow As Long
Dim r1 As Range
Dim v1 As Variant
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
v1 = ActiveSheet.Range(Cells(1, 8), Cells(lastrow, 27)).Value2
bUnion = False
For i = 2 To lastrow
If v1(i, 1) <> "RVWD" Then
If bUnion Then
Set r1 = Union(r1, Cells(i, 1))
Else
Set r1 = Cells(i, 1)
bUnion = True
End If
End If
Next i
r1.EntireRow.Delete
Thank you. sorry if my english is not so good.
First and foremost happy holidays and thank you</SPAN></SPAN> for any help provided. I have copied a code from internet and I would like to modify it but dont know how ?
In the code below: it deletes the entire row rows based on the criteria different "RVWD" .
I would to modify it so deleted Rows different "RVWD","NEW","APRV".
Dim bUnion As Boolean
Dim i As Long, lastrow As Long
Dim r1 As Range
Dim v1 As Variant
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
v1 = ActiveSheet.Range(Cells(1, 8), Cells(lastrow, 27)).Value2
bUnion = False
For i = 2 To lastrow
If v1(i, 1) <> "RVWD" Then
If bUnion Then
Set r1 = Union(r1, Cells(i, 1))
Else
Set r1 = Cells(i, 1)
bUnion = True
End If
End If
Next i
r1.EntireRow.Delete
Thank you. sorry if my english is not so good.