#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default case

is it possible to check the case of a letter. All the functions i found in
help seem to be able to convert text to a particular case but not check the
case
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default case

dim myString as string

myString = "a"
if ucase(mySting) = mystring then
msgbox "UpperCase"
else
msgbox "LowerCase"
endif
--
HTH...

Jim Thomlinson


"phil" wrote:

is it possible to check the case of a letter. All the functions i found in
help seem to be able to convert text to a particular case but not check the
case

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default case

You can use =exact()

=exact(a1,upper(a1))

maybe????



phil wrote:

is it possible to check the case of a letter. All the functions i found in
help seem to be able to convert text to a particular case but not check the
case


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default case

And VBA also has a StrComp function.

You could use that to test for exact matches, too.

phil wrote:

is it possible to check the case of a letter. All the functions i found in
help seem to be able to convert text to a particular case but not check the
case


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default case

here's a less elegant way than the others, but just as an example


Sub test()
Debug.Print Asc(Range("A1").Value)
If Asc(Range("A1").Value) <= 90 And Asc(Range("A1").Value) = 65 Then
Range("B1").Value = "UPPER CASE"
End If
If Asc(Range("A1").Value) = 97 And Asc(Range("A1").Value) <= 122 Then
Range("B1").Value = "lower case"
End If
End Sub

--


Gary


"phil" wrote in message
...
is it possible to check the case of a letter. All the functions i found in
help seem to be able to convert text to a particular case but not check the
case





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default case


phil Wrote:
is it possible to check the case of a letter. All the functions i found
in
help seem to be able to convert text to a particular case but not check
the
case

Hi Phil,
To add to the other info here;

If data to be checked is in A6

'=IF(EXACT(A6,UPPER(A6)),"Upper Case",IF(EXACT(A6,LOWER(A6)),"Lower
Case","Upper and Lower Case"))


--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=515572

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
change data of entire column from small case to upper case Ann Excel Worksheet Functions 1 August 16th 08 01:06 PM
How do I change from upper case to proper case in excel 2002 CT Man[_2_] Excel Discussion (Misc queries) 8 January 8th 08 06:14 PM
Changing multiple cell text from lower case to upper case Patti Excel Discussion (Misc queries) 2 January 4th 08 08:35 PM
Change the text from lower case to upper case in an Excel work boo dave01968 Excel Discussion (Misc queries) 2 December 9th 05 09:09 AM
How to use formula auditing to change upper case to Title Case. ScoobeyDoo Excel Worksheet Functions 1 November 19th 04 06:26 PM


All times are GMT +1. The time now is 12:32 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"