1

I am using

Set Fcell = tmpSheet.Range("A2:A" & lastrow).Find(What:="To find Value")

Now I want to search either for "To find Value" or "To find word" in the same cell. How to do it?

2
  • If you have found the cell with "To find Value" why do you what to write the same ("To find Value") in it? This words are already in? Commented Oct 1, 2015 at 9:17
  • Yes as from this line I can get "To find value" but now I want to get both "To find value" as well as "To find word". means if the control find any of them just put the value in fcell. Commented Oct 1, 2015 at 9:22

1 Answer 1

2

Try this:

Set Fcell = tmpSheet.Range("A2:A" & lastrow).Find(What:="To find Value")
If Fcell Is Nothing Then 
   Set Fcell = tmpSheet.Range("A2:A" & lastrow).Find(What:="To find word")
End If

If Not Fcell Is Nothing Then
  ' found, set the value
Else
  ' not found :(
End If
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.