View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Substring check within VBA

One way:

Dim bSubString As Boolean
bSubString = InStr(Str2, Str1) 0


In article ,
"Gary's Student" wrote:

If Str1 and Str2 are strings, is there a function or simple coding within VBA
to return TRUE if Str1 is a substring of Str2, otherwise FALSE?

Thanks in advance