FIND is a very powerful function in VBA but it doesn't support OR condition. Hence, if you want to find say two values "A" or "B", then you can code an array within FIND. To do OR in FIND, you will need to use following code (this is a sample code only, there can be many variations of this code)
Sub FindOR() Dim Result As Range, Result1 As Range, Result2 As Range On Error Resume Next Set Result1 = Cells.Find("A", LookIn:=xlValues, LookAt:=xlWhole) Set Result2 = Cells.Find("B", LookIn:=xlValues, LookAt:=xlWhole) On Error GoTo 0 Select Case True Case Result1 Is Nothing And Result2 Is Nothing: Exit Sub Case Not Result1 Is Nothing And Result2 Is Nothing: Set Result = Result1 Case Result1 Is Nothing And Not Result2 Is Nothing: Set Result = Result2 Case Not Result1 Is Nothing And Not Result2 Is Nothing: Set Result = Union(Result1, Result2) End Select End Sub
whoah this weblog is excellent i really like reading your articles.
Keep up the great work! You know, lots of people are looking around for this information, you could aid
them greatly.
Also visit my webpage – bclub.cm not working
Superb blog! Do you have any tips for aspiring writers?
I'm hoping to start my own blog soon but I'm a little lost on everything.
Would you propose starting with a free platform like WordPress or
go for a paid option? There are so many choices out there that I'm totally overwhelmed ..
Any recommendations? Kudos!
Also visit my blog post … briansclub cc register