Find - 2 possible things to find

  • Thread starter Thread starter jlclyde
  • Start date Start date
J

jlclyde

I am using VBA to find a specific value. The problem is that humans
have not used the standad form and have changed the thing that I want
found. I want to find "1st Converting run" or "1st. Converting Run".
Notice the period behind the 1st
I want to note the address of either of these finds.
Thanks,
Jay
 
Hi Jay !! :)
...so you find twice once for each of the two slighyly
different strings !
 
On my worksheet, F12 has: 1st Converting run (no period)
F13 has: 1st. Converting run (with the period)
The sub below displays OK for each cell

Sub testit2()
mytest = "1st Converting run"
For Each mycell In Range("F12:F13")
If WorksheetFunction.Substitute(mycell, ".", "") = mytest Then
MsgBox "OK"
Else
MsgBox "No match"
End If
Next
End Sub

best wishes
 
Hi Jay !! :)
                   ...so you find twice once for eachof the two slighyly
different strings !





- Show quoted text -

I want to find the address of which ever one is present and not bug
out or throw an error. Both will never be present in the same sheet.
Thanks,
Jay
 

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