VBA check e-mail input


Function IsEmailAddress(txt As String) As Boolean
    With CreateObject("VBScript.RegExp")
        .Pattern = "^[\w-\.]+@([\w-]+\.)+[A-Za-z]{2,3}$"
        IsEmailAddress = .test(txt)
    End With
End Function