Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / July 2004

Tip: Looking for answers? Try searching our database.

validating an e-mail address in excel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ragner D - 28 Jul 2004 12:24 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.