what's the formula or reg i should use in excel spreadsheet
to validate a e-mail address of the format xxxxxx...@XXXX.XXX
I donno how i shud do ti ..cud someone please help?
Thanx in advance
Jason Morin - 28 Jul 2004 15:22 GMT
You could validate it to check to see if the string
contains an "@" and contains a "." somewhere after
the "@". Try:
=IF(AND(ISNUMBER(FIND("@",A1)),ISNUMBER(FIND(".",A1,FIND
("@",A1)+1))),"valid e-mail","no")
HTH
Jason
Atlanta, GA
>-----Original Message-----
>what's the formula or reg i should use in excel spreadsheet
>to validate a e-mail address of the format xxxxxx...@XXXX.XXX
>I donno how i shud do ti ..cud someone please help?
>Thanx in advance
>.
Frank Kabel - 28 Jul 2004 19:36 GMT
Hi
one way: Enter the following code in one of your workbook modules
Public Function MailaddressOK(Adresse As String) As Boolean
Dim oVScriptRegEx As Object
Set oVScriptRegEx = CreateObject("VBScript.RegExp")
With oVScriptRegEx
.Pattern = "^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$"
MailaddressOK = .test(Adresse)
End With
End Function
you may have to register the VBSCRIPT object first in the VBE to use
regular expressions.
in your worksheet you can now enter the formula
=MailaddressOK(A1)
to check A1 for a valid email

Signature
Regards
Frank Kabel
Frankfurt, Germany
> what's the formula or reg i should use in excel spreadsheet
> to validate a e-mail address of the format xxxxxx...@XXXX.XXX
> I donno how i shud do ti ..cud someone please help?
> Thanx in advance