comlex Find statement

  • Thread starter Thread starter Farooq Sheri
  • Start date Start date
F

Farooq Sheri

Is it possible to write a single Find statement in code that will search for
a first string in say Range("A2") and if true look for another string in
Range("B2").
 
Why do you think it is important for it to be a single statement? Aside from
that, it would have been nice if you gave some examples so we would know if
you are trying to find whole or partial matches. With that said, I don't
think you need to use the Find function at all. If you are looking for whole
matches, then just test the cells content directly...

If Range("A2").Value = "Text1" And Range("B2").Value = "Text2" Then

If, on the other hand, you are looking for partial matches, then use the
InStr function...

If InStr(Range("A2").Value, "Text1") > 0 And _
InStr(Range("B2").Value, "Text2") > 0 Then
 
Back
Top