You can use Regular Expressions if you use VBScript.RegExp, creating a
function that you can use.
Here is an example that validates email addresses.
'-----------------------------------------------------------------
Public Function ValidEmail(Adress As String) As Boolean
'-----------------------------------------------------------------
Dim oRegEx As Object
Set oRegEx = CreateObject("VBScript.RegExp")
With oRegEx
.Pattern = "^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$"
' .Pattern = "^(\w+\.)*(\w+)@(\w+\.)+([a-zA-Z]{2,4})$"
ValidEmail = .Test(Adress)
End With
Set oRegEx = Nothing
End Function
--
HTH
RP
(remove nothere from the email address if mailing direct)
"vigi98" wrote in message
...
Hello all,
I would like to know if it is possible to handle regular expressions in
Excel, in VB or in formulas. I would like to do things such as "if
cells(x,y)=<regexp then ..."
Is that possible ?
Thanks in advance.