Checks if entered email ID is structurally valid or not
Note: Google Spreadsheet contains in-built function named ISEMAIL for same functionality
email_address(String)
Cell Reference or Text containing email
(Boolean) Validation result as TRUE / FALSE
Function ISVALIDEMAIL(email_address As String) As Boolean Dim expr As New RegExp expr.Pattern = "^[\w\.-]+@[\w\.-]+\.\w{2,}$" ISVALIDEMAIL = expr.Test(email_address) End Function
Function ISVALIDEMAIL(email_address As String) As Boolean
Dim expr As New RegExp
expr.Pattern = "^[\w\.-]+@[\w\.-]+\.\w{2,}$"
ISVALIDEMAIL = expr.Test(email_address)
End Function
This Excel VBA Macro uses Regular Expression feature, which is not available by default. So it has to be referenced in VBA Project using below steps