JawaharPrem
Member
Hi All,
i have to delete entire row with given criteria, i have enclosed sample file for reference.
example - in attached excel file in coloum "type"=if "Vrp and Mnp" the entire rows should be delete.
i have write a code but total data has deleted after running this query. Please help on same.
Sub test()
Dim i As Integer
i = 2
Do While Sheet1.Cells(i, 2) <> ""
i = i + 1
Loop
For i = 1 To 10000
If (Cells(i, 4) = "") Then
Exit For
Else
If ((Cells(i, 4) = "MNP") Or (Cells(i, 4) = "VRP")) Then Rows.EntireRow.Delete
End If
Next i
End Sub
Thanks
Jawahar Prem
i have to delete entire row with given criteria, i have enclosed sample file for reference.
example - in attached excel file in coloum "type"=if "Vrp and Mnp" the entire rows should be delete.
i have write a code but total data has deleted after running this query. Please help on same.
Sub test()
Dim i As Integer
i = 2
Do While Sheet1.Cells(i, 2) <> ""
i = i + 1
Loop
For i = 1 To 10000
If (Cells(i, 4) = "") Then
Exit For
Else
If ((Cells(i, 4) = "MNP") Or (Cells(i, 4) = "VRP")) Then Rows.EntireRow.Delete
End If
Next i
End Sub
Thanks
Jawahar Prem