Sub Validate_Email_Address()
Dim objRegExp As New RegExp
Dim blnIsValidEmail As Boolean
Dim rowLooper As Long
'Activate Microsoft VBScript Regular Expressions 5.5
For rowLooper = 2 To ActiveSheet.UsedRange.Rows.Count
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "^([a-zA-Z0-9_\-\.]+)@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$"
blnIsValidEmail = objRegExp.test(Range("C" & rowLooper).Value) '<===============EMAIL ADDRESS TO TEST==============
Range("D" & rowLooper).Value = blnIsValidEmail '<===============RESULTS==============
Next
MsgBox "Done"
End Sub
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.