ISVALIDEMAIL
Intro

Checks if entered email ID is structurally valid or not
Note: Google Spreadsheet contains in-built function named ISEMAIL for same functionality

Syntax
=ISVALIDEMAIL(email_address)
Input

email_address(String)
Cell Reference or Text containing email

Output

(Boolean) Validation result as TRUE / FALSE

Code
Target Platform:
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
Download
Example

script library isvalidemail example

Dependency (VBA)

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

  1. In Excel press Alt + F11 which will open VBA Macro editor
  2. Go to Tools > References which will open VBA Project References dialog
  3. Locate & Tick Microsoft VBScript Regular Expression 5.5 as shown in below image
    script library regular expression dependency screenshot
  4. Click OK & close VBA Window
To write any comments or post queries, kindly sign-in to your Facebook & then refresh this page