Function chkMach(sString As String, pattern As String, _
Optional bIgnoreCase As Boolean = True, _
Optional bGlobal As Boolean = True) As Boolean
Dim oRegExp As Object
On Error GoTo ERR_Handler:
If pattern = "" Then
chkMach = False
Exit Function
End If
If sString = "" Then
chkMach = False
Exit Function
End If
Set oRegExp = CreateObject("vbScript.RegExp")
With oRegExp
.IgnoreCase = bIgnoreCase
.Global = bGlobal
.pattern = pattern
chkMach = .Test(sString)
End With
END_Handler:
Set oRegExp = Nothing
Exit Function
ERR_Handler:
chkMach = False
Resume END_Handler:
End Function
wtorek, 10 marca 2009
Prosty przykład wykorzystania funkcji chkMach w Excel-u
Subskrybuj:
Komentarze do posta (Atom)
Brak komentarzy:
Prześlij komentarz