Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default URGENT! check if cell has only ALPHA chars

hi,

is there a way to check if a cell has ONLY alpha
characters entered into it?

i know there is 'isNumber' but is there something for
letters?

thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default URGENT! check if cell has only ALPHA chars

IsText checks if it is stored as text.

But numbers can be stored as text as well.

What is your definition of alpha characters. Is AB234 considered to be
alpha characters?

What about special characters like punctuation and other characters besides
the unendorned letters of the alphabet and numbers?

--
Regards,
Tom Ogilvy

wrote in message
...
hi,

is there a way to check if a cell has ONLY alpha
characters entered into it?

i know there is 'isNumber' but is there something for
letters?

thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default URGENT! check if cell has only ALPHA chars

sorry i shoulda been more clear!

only alphabet (upper/lower) abcd...xyz and ABC...XYZ


-----Original Message-----
IsText checks if it is stored as text.

But numbers can be stored as text as well.

What is your definition of alpha characters. Is AB234

considered to be
alpha characters?

What about special characters like punctuation and other

characters besides
the unendorned letters of the alphabet and numbers?

--
Regards,
Tom Ogilvy

wrote in message
...
hi,

is there a way to check if a cell has ONLY alpha
characters entered into it?

i know there is 'isNumber' but is there something for
letters?

thanks



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default URGENT! check if cell has only ALPHA chars

hi,
yes. ISTEXT
-----Original Message-----
hi,

is there a way to check if a cell has ONLY alpha
characters entered into it?

i know there is 'isNumber' but is there something for
letters?

thanks
.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default URGENT! check if cell has only ALPHA chars

You posted this in the programming newsgroup. Are you looking for a VBA
solution? If so, if you want to restrict to the letters A-Z (upper or lower
case)

Function AllLetters(sText As String) As Boolean
Dim Bytes() As Byte
Dim i As Long

Bytes = UCase$(sText)
For i = 0 To UBound(Bytes(), 1) Step 2
If Bytes(i) < 65 Or Bytes(i) 90 Then
AllLetters = False
Exit Function
End If
Next i
AllLetters = True
End Function

If you want to allow other characters besides A-Z, you could set up a Select
Case block instead of the If statement

Select Case Bytes(i)
Case 65 to 90, 32, 46, 44 'letters, space, period, and comma
'above are OK, don't do anything
Case Else
AllLetters = False
Exit Function
End Select



On Wed, 29 Sep 2004 08:28:45 -0700,
wrote:

hi,

is there a way to check if a cell has ONLY alpha
characters entered into it?

i know there is 'isNumber' but is there something for
letters?

thanks


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
How to truncate list of meaningful words greater than 15 chars tomeaningful words of 8 chars. Babloo Excel Worksheet Functions 4 April 29th 11 11:27 PM
limit # of chars in a cell soonic Excel Discussion (Misc queries) 1 March 22nd 10 11:21 AM
Check for Alpha characters TimE Excel Discussion (Misc queries) 4 November 10th 05 12:31 AM
Need help with check box coding, urgent!!! inbound03[_10_] Excel Programming 0 January 6th 04 06:47 PM
Need help with check box coding, urgent!!! inbound03[_9_] Excel Programming 0 January 6th 04 06:29 PM


All times are GMT +1. The time now is 11:58 PM.

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

About Us

"It's about Microsoft Excel"