Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 186
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IsNumeric with array or range Jerry M New Users to Excel 4 April 24th 07 01:29 PM
opposite of IsNumeric thephoenix12 Excel Discussion (Misc queries) 10 June 24th 05 07:37 PM
IsNumeric Test scott Excel Programming 5 February 8th 05 07:59 PM
Not IsNumeric not working - or is it me? Ed Excel Programming 3 January 6th 05 11:30 PM
check Isnumeric, doesnot work well helmekki[_17_] Excel Programming 3 August 7th 04 03:34 AM


All times are GMT +1. The time now is 05:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"