manoj_arsul
Board Regular
- Joined
- Jun 27, 2018
- Messages
- 61
I have the below program for delete row if specific value content in column . but it getting too much time for running .
I want to run the same program but take less time.
Also help me for the run that program for different sheet (Sheet2)
Sub DeleteRowContents()
last = Cells(Rows.Count, "G").End(xlUp).Row
For i = last To 1 Step -1
If (Cells(i, "G").Value) = "ABCD" Then
Cells(i, "A").EntireRow.Delete
End If
Next i
For i = last To 1 Step -1
If (Cells(i, "G").Value) = "XYZ" Then
' Cells(i, "A").EntireRow.Delete
End If
Next i
For i = last To 1 Step -1
If (Cells(i, "G").Value) = "PQR" Then
Cells(i, "A").EntireRow.Delete
End If
Next i
End Sub
I want to run the same program but take less time.
Also help me for the run that program for different sheet (Sheet2)
Sub DeleteRowContents()
last = Cells(Rows.Count, "G").End(xlUp).Row
For i = last To 1 Step -1
If (Cells(i, "G").Value) = "ABCD" Then
Cells(i, "A").EntireRow.Delete
End If
Next i
For i = last To 1 Step -1
If (Cells(i, "G").Value) = "XYZ" Then
' Cells(i, "A").EntireRow.Delete
End If
Next i
For i = last To 1 Step -1
If (Cells(i, "G").Value) = "PQR" Then
Cells(i, "A").EntireRow.Delete
End If
Next i
End Sub