View Single Post
 
Old 08-07-2020, 08:30 AM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Graham,


What is/was your intent with the parts of your function that I've stetted out below:

Code:
Function TestRegExp(strFind As String, strText As String) As Boolean
Dim objRegExp As Object
'Dim objMatch As Object
'Dim colMatches As Object
    TestRegExp = False
    Set objRegExp = CreateObject("VBScript.RegExp")
    objRegExp.Pattern = strFind
    objRegExp.IgnoreCase = True
    objRegExp.Global = True
    If (objRegExp.Test(strText) = True) Then TestRegExp = True
'        Set colMatches = objRegExp.Execute(strText)
'        For Each objMatch In colMatches
'            TestRegExp = True
'            Exit For
'        Next
'    End If
    Set objRegExp = Nothing
'    Set colMatches = Nothing
'    Set objMatch = Nothing
End Function
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote