Excel Friends,
I developed this code and it works fine, but I need that the actual string found be the result of the function. For example:
If the String is fsdhjfh383hjdjhf8ur2hjfhds/O123456/nfejhfjhef8343847832832/dhhfjshjfh/dhsjdjd the function result should be: O123456
Thanks for any help!
I developed this code and it works fine, but I need that the actual string found be the result of the function. For example:
If the String is fsdhjfh383hjdjhf8ur2hjfhds/O123456/nfejhfjhef8343847832832/dhhfjshjfh/dhsjdjd the function result should be: O123456
Thanks for any help!
Code:
Function STRNEEDED(ByVal StrTested As String) As Boolean
'This function checks the syntax of the StrTesteds
Dim regEx As New VBScript_RegExp_55.RegExp
With regEx
.ignorecase = True
.Pattern = "\\[a-zA-Z]{1}[0-9]{6}\\"
If .test(StrTested) = False Then GoTo BadStrTested
End With
STRNEEDED = True
'String Found = ???????
Exit Function
BadStrTested:
STRNEEDED = False
'String Found = "N/A"
End Function