Forum Discussion
InTh0ught
Dec 14, 2024Copper Contributor
Modifying Delete Row based on Extract from Text
Column A has two repeating rows that need to be removed. Column A contains: column1 total amount I am not proficient enough to modify the following to delete these rows Sub DeleteRows() Dim iLas...
HansVogelaar
Dec 16, 2024MVP
Does this do what you want?
Sub DeleteRows()
Dim iLastRow As Long
Dim i As Long
Application.ScreenUpdating = False
iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 1 Step -1
If Cells(i, "A").Value = "column1" Or Cells(i, "A").Value = "total amount" Then
Rows(i).Delete
End If
Next i
Application.ScreenUpdating = True
End Sub