Excel macro that deletes all rows which doesn't contain the ch
I used this short solution suggested to me in another forum:
Dim r As Range
Dim DelRs As Range
Set r = Range("E1")
Do Until r.Value = ""
If InStr(r.Value, "|") = 0 Then
If Not DelRs Is Nothing Then
Set DelRs = Union(DelRs, r)
Else
Set DelRs = r
End If
End If
Set r = r.Offset(1, 0)
Loop
DelRs.EntireRow.Delete
Thanks to all (Adriano and Norman) anyway for your contribution!
|