View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Maileen[_2_] Maileen[_2_] is offline
external usenet poster
 
Posts: 9
Default Find a string into another string

thanks a lot,
it works great. :)

Maileen

Jim Thomlinson wrote:
Try using the instr function. It returns the location of the beginning of one
text string withing another. If the string is not found it returns zero.

HTH

"Maileen" wrote:


Hi,

I would like to know if a String belongs to another string.

for example :
Dim KeyString as String
Dim Sentence as String
Dim Result as Interger

Result = worksheetFunction.Find(KeyString,Sentence)
if (Result<"") then
Msgbox "KeyString exists within Senetence"
EndIf

but it doesn't work.
i just want to check if my KeyString belongs to Sentence, that's all.
basically i store into Sentence the value of a cell.
thx

Maileen