+ Reply to Thread
Results 1 to 3 of 3

opposite of IsNumeric

Hybrid View

thephoenix12 opposite of IsNumeric 06-23-2005, 03:17 PM
Guest Re: opposite of IsNumeric 06-23-2005, 05:05 PM
Guest RE: opposite of IsNumeric 06-23-2005, 06:05 PM
  1. #1
    Registered User
    Join Date
    06-15-2005
    Posts
    39

    opposite of IsNumeric

    Hi,

    I know that IsNumeric returns true if the selection is only numbers, but is there a function that returns true if the selection is all text? Using If Not IsNumeric does not work, because if something contains text and numbers it returns true, which is what I do not want.

    Thanks,

    Steve

  2. #2
    Tom Ogilvy
    Guest

    Re: opposite of IsNumeric

    Look at VBA HELP on the LIKE operator.

    --
    Regards,
    Tom Ogilvy




    ..1r3i6x_1119557176.2224@excelforum-nospam.com> wrote in message
    news:thephoenix12.1r3i6x_1119557176.2224@excelforum-nospam.com...
    >
    > Hi,
    >
    > I know that IsNumeric returns true if the selection is only numbers,
    > but is there a function that returns true if the selection is all text?
    > Using If Not IsNumeric does not work, because if something contains
    > text and numbers it returns true, which is what I do not want.
    >
    > Thanks,
    >
    > Steve
    >
    >
    > --
    > thephoenix12
    > ------------------------------------------------------------------------
    > thephoenix12's Profile:

    http://www.excelforum.com/member.php...o&userid=24336
    > View this thread: http://www.excelforum.com/showthread...hreadid=381732
    >




  3. #3
    Ken Hudson
    Guest

    RE: opposite of IsNumeric

    It is not pretty, but if you had only numbers and/or letters and you wanted
    to check for at least one number in the string:

    Option Explicit
    Sub AllText()
    Dim i As Integer
    Dim TestString As String
    TestString = Range("A1")
    For i = 1 To Len(TestString)
    If IsNumeric(Mid(TestString, i, 1)) Then
    MsgBox ("Not text")
    Exit For
    End If
    Next i
    End Sub
    --
    Ken Hudson


    "thephoenix12" wrote:

    >
    > Hi,
    >
    > I know that IsNumeric returns true if the selection is only numbers,
    > but is there a function that returns true if the selection is all text?
    > Using If Not IsNumeric does not work, because if something contains
    > text and numbers it returns true, which is what I do not want.
    >
    > Thanks,
    >
    > Steve
    >
    >
    > --
    > thephoenix12
    > ------------------------------------------------------------------------
    > thephoenix12's Profile: http://www.excelforum.com/member.php...o&userid=24336
    > View this thread: http://www.excelforum.com/showthread...hreadid=381732
    >
    >


+ 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