View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_4_] Bob Phillips[_4_] is offline
external usenet poster
 
Posts: 834
Default Using WorksheetFunction.Find in VBA

Use Instr

Result = InStr(y, third) 0


--

HTH

Bob

"Schizoid Man" wrote in message
...
Hi,

I have the following code snippet that I'm using to find whether one digit
is part of another large number using something like:

If IsNumeric(WorksheetFunction.Find(Third, y)) Then
Result = TRUE
Else
Result = FALSE
End If

where y is the large number and 'Third' represents the a particular digit.
If the expression in the IF statement does contain the said digit, the
result of the statement is that Result variable is assigned the value
TRUE. However, if the digit is not contained, then rather than hitting the
ELSE bit of the above statement, the code just unexpectedly terminates.

Any suggestions?

Thx,
Schiz