Find - 2 possible things to find

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
 
V

Vijay Chary

Hi Jay !! :)
...so you find twice once for each of the two slighyly
different strings !
 
B

Bernard Liengme

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
 
J

jlclyde

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
 
Top