Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Filter out bad email addresses

Does anyone have existing code that filters out bad email
addresses. I can write my own routine, but i need to know
what characters are not allowed on the Left and right of
the @ sign.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Filter out bad email addresses

Not sure about the exact regular expression here but something like
this should work.

Tim.


Function EmailOK(sIn As String) As Boolean

Static regEx As Object

bValid = False
If regEx Is Nothing Then
Set regEx = CreateObject("vbscript.regexp")
regEx.Pattern =
"^[A-Z][\w\.-]*[A-Z0-9]@[A-Z0-9][\w\.-]*[A-Z0-9]\.[A-Z][A-Z\.]*[A-Z]$"
regEx.Global = True
regEx.IgnoreCase = True
End If

EmailOK = regEx.test(sIn)

End Function




"Chris W." wrote in message
...
Does anyone have existing code that filters out bad email
addresses. I can write my own routine, but i need to know
what characters are not allowed on the Left and right of
the @ sign.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Macro how to create email link for the email addresses in aRange or Selection Satish[_2_] Excel Worksheet Functions 8 December 28th 09 03:30 PM
Using Advanced Filter to extract email addresses Frank Wood Excel Discussion (Misc queries) 4 March 1st 07 10:54 PM
filter email addresses Angel Excel Discussion (Misc queries) 3 August 20th 06 12:41 PM
can I copy a column of email addresses, paste into email address? Lizizfree New Users to Excel 4 July 20th 06 10:03 PM
Transfer Email addresses from spreadsheet to email address book Beana Excel Discussion (Misc queries) 2 May 30th 06 06:07 PM


All times are GMT +1. The time now is 03:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"