E
Elby
I'm trying to eliminate records in an Excel database where one field
fits any of several criteria. I've got a code that works for one
instance (in the example below, Dukakis), but I want to look for about
20 names and delete them. Any ideas?
If I were in Excel, I'd use OR, as in
=IF(OR(A1 = "dukakis",A1 = "*smith"),"value if true","value if
false")
But I can't get OR to work in VBA (and I can't search for help in
Google!)
Here's my code so far:
'Remove workflow Worksheets
Range("a1", Range("a1").End(xlDown)).Select
Set RNG = Selection
For Each D In RNG
If D.Value Like "*Dukakis*" Then
D.EntireRow.Delete
End If
Next
fits any of several criteria. I've got a code that works for one
instance (in the example below, Dukakis), but I want to look for about
20 names and delete them. Any ideas?
If I were in Excel, I'd use OR, as in
=IF(OR(A1 = "dukakis",A1 = "*smith"),"value if true","value if
false")
But I can't get OR to work in VBA (and I can't search for help in
Google!)
Here's my code so far:
'Remove workflow Worksheets
Range("a1", Range("a1").End(xlDown)).Select
Set RNG = Selection
For Each D In RNG
If D.Value Like "*Dukakis*" Then
D.EntireRow.Delete
End If
Next