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 contain text and numbers it returns true, which is what I do not want. Thanks, Stev -- thephoenix1 ----------------------------------------------------------------------- thephoenix12's Profile: http://www.excelforum.com/member.php...fo&userid=2433 View this thread: http://www.excelforum.com/showthread.php?threadid=38173 |
opposite of IsNumeric
Look at VBA HELP on the LIKE operator.
-- Regards, Tom Ogilvy wrote in message news:thephoenix12.1r3i6x_1119557176.2224@excelforu m-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 |
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 |
All times are GMT +1. The time now is 12:22 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com