Hello I'm having some issue tring to get the regular expression code below to work. I'm getting a application-undefine or Object-Undefine error
the text box is on user form.
the error is occurring on the line "Set allMatches = regEx.Execute(TextBox1.Text)" not sure what I missed.
Dim regEx As Object
Dim allMatches As Object
Set regEx = CreateObject("VBScript.RegExp")
With regEx
.IgnoreCase = True
.MultiLine = False
.Pattern = "\d{2,2}/\d{2,2}/\d{4,4} \d{2,2}:\d{2,2)[AM|PM]"
.Global = True
End With
Set allMatches = regEx.Execute(TextBox1.Text)
If allMatches.Count <> 0 Then
result = allMatches.Item(0).submatches.Item(0)
End If