L
ljCharlie
Is there a formula where I can use to check if the email address is
valid or not? Help is much appreciated.
valid or not? Help is much appreciated.
Is there a formula where I can use to check if the email address is
valid or not? Help is much appreciated.
Bob said:Add this VBA function
'-----------------------------------------------------------------
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
and use like
=ValidEmail([email protected])
Many thanks for the help. By valid I mean an email address should have a
quotation, apostrophe, period, colon, and semicolon at the end or in
some part of the email address where it's not suppose to be.
ljCharlie said:Bob said:Add this VBA function
'-----------------------------------------------------------------
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
and use like
=ValidEmail([email protected])
How do I modify the code so that I can specify an email column?