Leading the way in Microsoft Office Development
 Home|Excel|Word|PowerPoint|Consultancy|Feedback|Contact 
 Microsoft Excel > Functions User Defined > ISLIKE< Previous | Next > 

 

ISLIKE(sText, sPattern)

 
 

Returns whether a particular string matches a certain pattern.

 

 
sTextThe text you want to test.
sPatternThe pattern you want to check.
 

 

REMARKS

 
 
  • You can use the built-in COUNTIF() function to achieve the same thing.

     
     
  • You cannot use the [] operator in your patterns if you use the COUNTIF function.

     

     
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    Option Explicit

    Public Function ISLIKE(sText As String, _
                           sPattern As String) As Boolean
       If sText Like pattern Then
          ISLIKE = True
       Else
          ISLIKE = False
       End If
    End Function
       

     

    Example

     
       

     Copyright © 2004-2007 Better Solutions Limited. All Rights Reserved.< Previous | Top | Next >