Dinesh_Excel
Member
Hello Friends,
I have tried macro for to delete multiple rows containing different text in three different
columns.
But I am not getting the output ..Any Help
Is there any better way to write the code to run without errors..
I have tried macro for to delete multiple rows containing different text in three different
columns.
But I am not getting the output ..Any Help
Is there any better way to write the code to run without errors..
Code:
Sub MultiDelete2()
With Application
.ScreenUpdating = False
.DisplayAlerts = False
End With
For Each cell In Range("A2:A200")
Select Case cell.value
Case "Name1", "Name2", "Name3"
cell.EntireRow.Delete
End Select
Next cell
With Application
.ScreenUpdating = True
.DisplayAlerts = True
End With
Call MultiDelete3
End Sub
Sub MultiDelete3()
With Application
.ScreenUpdating = False
.DisplayAlerts = False
End With
For Each cell In Range("C2:C200")
Select Case cell.value
Case "Name4", "Name5", "Name6"
cell.EntireRow.Delete
End Select
Next cell
With Application
.ScreenUpdating = True
.DisplayAlerts = True
End With
Call MultiDelete4
End Sub
Sub MultiDelete4()
With Application
.ScreenUpdating = False
.DisplayAlerts = False
End With
For Each cell In Range("D2:D200")
Select Case cell.value
Case "Name8", "Name9", "Name10"
cell.EntireRow.Delete
End Select
Next cell
With Application
.ScreenUpdating = True
.DisplayAlerts = True
End With
End Sub