+ Reply to Thread
Results 1 to 4 of 4

Return True if cell contains special character

  1. #1
    linglc
    Guest

    Return True if cell contains special character

    How do I test if a cell has any of the special characters e.g. *,?,/
    Thanks for any help.

  2. #2
    Greg Wilson
    Guest

    RE: Return True if cell contains special character

    Try:

    Function CellHasSpecChar(c As Range) As Boolean
    CellHasSpecChar = c.Value Like "*[?/*]*"
    End Function

    Sub TestIt()
    MsgBox CellHasSpecChar(ActiveCell)
    End Sub

    Regards,
    Greg


    "linglc" wrote:

    > How do I test if a cell has any of the special characters e.g. *,?,/
    > Thanks for any help.


  3. #3
    Bob Phillips
    Guest

    Re: Return True if cell contains special character

    For ? and / you can use

    =ISNUMBER(FIND("/",A2)) etc..

    For *, best to use

    =ISNUMBER(FIND(CHAR(42),A2))

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "linglc" <[email protected]> wrote in message
    news:[email protected]...
    > How do I test if a cell has any of the special characters e.g. *,?,/
    > Thanks for any help.




  4. #4
    Bob Phillips
    Guest

    Re: Return True if cell contains special character

    If you want the test all in one, try

    =SUMPRODUCT(--(ISNUMBER(FIND({"*","/","?"},A1))))>0

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "linglc" <[email protected]> wrote in message
    news:[email protected]...
    > How do I test if a cell has any of the special characters e.g. *,?,/
    > Thanks for any help.




+ 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