Hey man, I think that's just it!!! my only problem now is I don't know how
to tell the collum or the cell to use it... could you help?
thanks
Bob Phillips wrote:
This function will test that an passed emaiul address is properly
02-Jul-07
This function will test that an passed emaiul address is properly
constructed
'-----------------------------------------------------------------
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}$"
ValidEmail = .Test(Adress)
End With
Set oRegEx = Nothing
End Function
--
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my
addy)
Previous Posts In This Thread:
On segunda-feira, 2 de Julho de 2007 11:21
user wrote:
Excel to check for regular expression?
Hi,
How do you use Regular expression in excel? For eg: Check a column of
data to see whether are all of them valid email addresses?
Please advise
THanks
On segunda-feira, 2 de Julho de 2007 11:56
FlickOlmsfor wrote:
By valid, do you mean that the email is in proper syntax or that it is an
By valid, do you mean that the email is in proper syntax or that it is an
actual email address.
Text formulas can be used for proper syntax. Perhaps a Visual Basic
proceedure.
I doubt you can check that the email address actually exists, as many
companies and ISPs will simply disregard and drop mail to invalid email
addresses to eliminate spam
:
On segunda-feira, 2 de Julho de 2007 12:28
Bob Phillips wrote:
This function will test that an passed emaiul address is properly
This function will test that an passed emaiul address is properly
constructed
'-----------------------------------------------------------------
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}$"
ValidEmail = .Test(Adress)
End With
Set oRegEx = Nothing
End Function
--
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my
addy)
On segunda-feira, 2 de Julho de 2007 14:13
Harlan Grove wrote:
Re: Excel to check for regular expression?
It doesn't handle every valid e-mail address. A lot more characters
than Latin letters, decimal numerals and underscores are allowed, at
least when the mailbox is inside double quotes.
...
...
FWIW, this would happily match
[email protected] and
[email protected]
which aren't valid e-mail addresses. Also, {1,} isn't as efficient
either in terms of typing or processing as +.
The very end of the e-mail address is the top-level domain, which
should only contain Latin letters but *could* span up to 6 letters
(currently as of posting date, e.g., .museum and .travel), so you want
to end the regexp with [A-Za-z]{2,6}$. However, literal IP addresses
are also supported, so the entire part to the right of the @ could be
((2([0-4]\d|5[0-5])|1\d{2}|[1-9]\d|[1-9])\.){3}(2([0-4]\d|5[0-5])|
1\d{2}|[1-9]\d|[1-9])
On segunda-feira, 2 de Julho de 2007 18:11
user wrote:
Re: Excel to check for regular expression?
So How do we start using it in Excel? Thanks
On ter?a-feira, 3 de Julho de 2007 3:39
Bob Phillips wrote:
as I showed.
as I showed.
--
HTH
Bob
(there is no email, no snail mail, but somewhere should be gmail in my
addy)
EggHeadCafe - Software Developer Portal of Choice
.NET Abstract Factory
http://www.eggheadcafe.com/tutorial...e-93ed-0f73ecb15b39/net-abstract-factory.aspx