G
Guest
Hi,
this is my first time trying out the ...for..each..next loop
I'm trying to delete the entire row if the cell in the E column contains the
word "USD". I tried the codes below and get "run time error 424, Object
require" error. Any help would be very much appreciated.
Sub deleteUSD()
Dim rng As Range
myrange = Range("E8:E500")
For Each rng In myrange
If rng.Value = "USD" Then
rng.EntireRow.Delete
End If
Next rng
End Sub
this is my first time trying out the ...for..each..next loop
I'm trying to delete the entire row if the cell in the E column contains the
word "USD". I tried the codes below and get "run time error 424, Object
require" error. Any help would be very much appreciated.
Sub deleteUSD()
Dim rng As Range
myrange = Range("E8:E500")
For Each rng In myrange
If rng.Value = "USD" Then
rng.EntireRow.Delete
End If
Next rng
End Sub