Find or Search Problem

V

VBAvirgin

Thank You Dave, your assistance is much appreciated. I attempted t
record my macro and then went in to edit it, and I thin
_that's_where_I_messed_up_.
Looking at your code, I'm trying to decipher where I could put
wildcard (*) option for the search in the event that the user doesn'
know the correct spelling. As it is, I believe it has to be an exac
match. Would it be a True/False or 0/1 variable?
I thought I was on the right track but obviously I was wrong. Thank yo
very much
 
D

Dave Peterson

Using the .find version:

Set FoundCell = .Cells.Find(what:="*" & myStr & "*", _
after:=.Cells(.Cells.Count), _
lookat:=xlPart, LookIn:=xlValues, _
searchorder:=xlByRows, _
searchdirection:=xlNext, _
MatchCase:=False)

(just wrapping the entered string with asterisks.)
 

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

Top