Find specific cell value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have two cells. One cell contains the text "dollar pop". The other
contains the text "pop". I am attempting to use the "Find" method to find
the cell that contains "pop". However, it finds "dollar pop" (the location
of this cell is before "pop").

How can I find a cell that matches an exact text value ("pop"), not a cell
that contains the search text plus possibly other text in addition ("dollar
pop")?

Thank you.
 
Use the arguments to the find method. In this case the Lookat argument:
set rng = Cells.Find("pop", Lookin:=xlValues, _
.Lookat:=xlWhole, MatchCase:=False)

See excel vba help on the find method of the range object for details.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top