View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default usings contains in var check

Hi Bruce,

Try something like:

Sub Test01()
Dim myVar As String

' myVar = "myfile01203"

If Len(myVar) 0 Then
'do something, e.g.
MsgBox myVar
Else
'do something else?
End If
End Sub

---
Regards,
Norman



"Bruce" wrote in message
...
How do I check that a variable 'contains' something?

eg.

myVar = "myfile01203"

If myVar contains "myfile" then
'do something
End if