Filter for bad email addresses

C

Cardinal

I am not a spammer but I do have a customer who has given me I a column
with 1200 email addresses in it. The person that entered these emails
sometimes includes or misses one of the following items.
- an extra space
- a missing period before the .com (or .net, etc) part of the email
- no @ symbol

Does anyone know of a function I could use to pull out any emails that
have one of these problems? If I can do that then I can send those back
to him with a note to fix. Thank you very much.
 
D

Don Guillett

You should be able to get rid of the extra space with TRIM and place the .
before com net etc with a looping macro that searches for that string.
INSTR. and you can search for missing @

Sub findmissing()
For Each c In Selection
If InStr(c, "@") = 0 Then c.Offset(, 1) = "bad" 'MsgBox c.Address
Next
End Sub
 
Top