View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Bruce Bruce is offline
external usenet poster
 
Posts: 138
Default usings contains in var check

Eric,

Ive got it;

If myVar like sStr & "*" Then

Bruce

"Eric" wrote:

Norman Jones wrote:

Hi Bruce,

sStr = "myfile01203"

If myVar = sStr Then
'do something, e.g.
MsgBox myVar
Else
'do something else?
End If

---
Regards,
Norman



"Bruce" wrote in message
...
Not quite what I was thinking. Let me try again.

I want to test whether my Var contains myfile. Any ideas...


No, you still dont see what he is saying.

sStr= "My dogs name is spot"

if sStr contains "spot" then
' do this code
end if

I havnt any idea how to do this in vba
in c its simple if(strstr(sStr, "spot"))
{
// do code here
}
I too was looking for this but unfortunately MS doesnt list functions in the
help - you have to already know the function name to find it.
At least thats my experience.
Eric