I have a column full of email addresses and I have been trying to create a macro that simply makes sure each address at least has an @ and . in it to eliminate the number of emails that bounce back.
I would prefer the macro to either check the range I highlighted or even the specific column since it will always be column A.
Also it would be ideal if it simply just highlighted the invalid emails. I was hoping this would be an easy fix for macro gurus.
After getting on the Internet and trying to learn VB and macros, below is what I have but its not working and it is using a message box instead of highlighting since I am not sure how to do that.
Sub ValidEmail()
Dim Cel As Range
For Each Cel In Intersect(Selection, ActiveSheet.UsedRange)
If InStr(1, Cel.Value, ".") = 0 Or InStr(1, Cel.Value, "@") = 0 Then
MsgBox "Email address not valid"
bNotValid = True
End If
Cel.Value = Cel.Value & ";"
Next
End Sub
Thanks for any help and tips.
Bookmarks