+ Reply to Thread
Results 1 to 6 of 6

how do I format a cell to validate for an e-mail address ( @ .com.

  1. #1
    RmeAV8tor
    Guest

    how do I format a cell to validate for an e-mail address ( @ .com.

    how do I format a cell to validate for an e-mail address ( @ .com, net, gov,
    etc)

    I want to make sure the user is entering a valid type of e-mail address.
    --
    Thanks,
    CTaylor

  2. #2
    Jason Morin
    Guest

    Re: how do I format a cell to validate for an e-mail address ( @ .com.

    There are a lot of domain extensions if you consider
    international. With the list of extensions in A1:A100,
    select the target cell, go to Data > Validation,
    under "Allow" select "Custom" and put:

    =SUMPRODUCT(--NOT(ISNA(MATCH("*@*"&$A$1:$A$5&"*",D1,0))))
    >0


    HTH
    Jason
    Atlanta, GA

    >-----Original Message-----
    >how do I format a cell to validate for an e-mail address

    ( @ .com, net, gov,
    >etc)
    >
    >I want to make sure the user is entering a valid type of

    e-mail address.
    >--
    >Thanks,
    >CTaylor
    >.
    >


  3. #3
    Bob Phillips
    Guest

    Re: how do I format a cell to validate for an e-mail address ( @ .com.

    Here is a function that you can use

    '-----------------------------------------------------------------
    Public Function ValidEmail(Adress As String) As Boolean
    '-----------------------------------------------------------------
    Dim oRegEx As Object
    Set oRegEx = CreateObject("VBScript.RegExp")
    With oRegEx
    .Pattern = "^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$"
    ValidEmail = .Test(Adress)
    End With
    Set oRegEx = Nothing
    End Function


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "RmeAV8tor" <[email protected](doNOTspam)> wrote in message
    news:[email protected]...
    > how do I format a cell to validate for an e-mail address ( @ .com, net,

    gov,
    > etc)
    >
    > I want to make sure the user is entering a valid type of e-mail address.
    > --
    > Thanks,
    > CTaylor




  4. #4
    Jason Morin
    Guest

    Re: how do I format a cell to validate for an e-mail address ( @ .com.

    Oops, it should be $A$1:$A$100 in the formula.

    Jaosn

    >-----Original Message-----
    >There are a lot of domain extensions if you consider
    >international. With the list of extensions in A1:A100,
    >select the target cell, go to Data > Validation,
    >under "Allow" select "Custom" and put:
    >
    >=SUMPRODUCT(--NOT(ISNA(MATCH("*@*"&$A$1:$A$5&"*",D1,0))))
    >>0

    >
    >HTH
    >Jason
    >Atlanta, GA
    >
    >>-----Original Message-----
    >>how do I format a cell to validate for an e-mail

    address
    >( @ .com, net, gov,
    >>etc)
    >>
    >>I want to make sure the user is entering a valid type

    of
    >e-mail address.
    >>--
    >>Thanks,
    >>CTaylor
    >>.
    >>

    >.
    >


  5. #5
    RmeAV8tor
    Guest

    Re: how do I format a cell to validate for an e-mail address ( @ .

    Bob,

    Where do I cut and paste your function to?


    "Bob Phillips" wrote:

    > Here is a function that you can use
    >
    > '-----------------------------------------------------------------
    > Public Function ValidEmail(Adress As String) As Boolean
    > '-----------------------------------------------------------------
    > Dim oRegEx As Object
    > Set oRegEx = CreateObject("VBScript.RegExp")
    > With oRegEx
    > .Pattern = "^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$"
    > ValidEmail = .Test(Adress)
    > End With
    > Set oRegEx = Nothing
    > End Function
    >
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "RmeAV8tor" <[email protected](doNOTspam)> wrote in message
    > news:[email protected]...
    > > how do I format a cell to validate for an e-mail address ( @ .com, net,

    > gov,
    > > etc)
    > >
    > > I want to make sure the user is entering a valid type of e-mail address.
    > > --
    > > Thanks,
    > > CTaylor

    >
    >
    >


  6. #6
    RmeAV8tor
    Guest

    Re: how do I format a cell to validate for an e-mail address ( @ .

    I copied the formula; but I get an invalid error message no matter what I put
    in the field. No matter right or wrong format, I always get an error.

    This is the validation formula as I entered it:
    =SUMPRODUCT(--NOT(ISNA(MATCH("*@*"&$AA$2:$AA$4&"*",D1,0))))>0
    where I put com, net, and gov in cells AA2 : AA4. I put both .com and (no
    dot) com; and still get errors.

    Can you tell what I am doing wrong? I deleted the >0 at the end and just
    ended the formula as ))))0; and still got an error.

    "Jason Morin" wrote:

    > Oops, it should be $A$1:$A$100 in the formula.
    >
    > Jaosn
    >
    > >-----Original Message-----
    > >There are a lot of domain extensions if you consider
    > >international. With the list of extensions in A1:A100,
    > >select the target cell, go to Data > Validation,
    > >under "Allow" select "Custom" and put:
    > >
    > >=SUMPRODUCT(--NOT(ISNA(MATCH("*@*"&$A$1:$A$5&"*",D1,0))))
    > >>0

    > >
    > >HTH
    > >Jason
    > >Atlanta, GA
    > >
    > >>-----Original Message-----
    > >>how do I format a cell to validate for an e-mail

    > address
    > >( @ .com, net, gov,
    > >>etc)
    > >>
    > >>I want to make sure the user is entering a valid type

    > of
    > >e-mail address.
    > >>--
    > >>Thanks,
    > >>CTaylor
    > >>.
    > >>

    > >.
    > >

    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1