Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function RegExCheck(pattern As String, targetCell As Range) As Boolean
- Dim regEx As Object
- Set regEx = CreateObject("VBScript.RegExp")
- ' Configure RegExp
- regEx.pattern = pattern
- regEx.IgnoreCase = False ' Set to True if case-insensitive matching is needed
- regEx.Global = False ' Only check for the first match
- ' Perform the match and return result
- RegExCheck = regEx.Test(targetCell.Value)
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement