Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do "Not Like" 1

Status
Not open for further replies.

jessedh

MIS
Apr 16, 2002
96
US
How would I do a compare of &quot;Not Like&quot; in VBA. I can't do <> b/c the variable changes from HELOC to HELOCs to Helo

Thanks
Jesse
 
Hi,
Code:
If Not (a Like b) Then...
Hope this helps :) Skip,
metzgsk@voughtaircraft.com
 
Function ISLIKE(Text As String, pattern As String) As Boolean
' TRUE if the first argument is like the second
' JOKERS: ? : any single char. * : any string
If Text Like pattern Then ISLIKE = True _
Else ISLIKE = False
End Function

Used as a worksheet func, you can type '=IF(ISLIKE(A1;&quot;bla*&quot;)=FALSE;&quot;DIFFERENT!&quot;;&quot;SIMILAR!&quot;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top