Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Determine whether a character is Upper or Lower case

Is there a function that will allow me to determine if a character is
either Upper or Lower Case? If not, any idea how I can build one in
VBA?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Determine whether a character is Upper or Lower case

give this function a try

public function IsUpperCase(byval InputString as string) as boolean
if ucase(inputstring) = inputstring then
IsUpperCase = true
else
IsUpperCase = false
end if
end function
--
HTH...

Jim Thomlinson


" wrote:

Is there a function that will allow me to determine if a character is
either Upper or Lower Case? If not, any idea how I can build one in
VBA?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Determine whether a character is Upper or Lower case

One character in A1?

=if(exact(a1),upper(a1)),"upper","not upper")

But you'll have to add a couple of checks if there's a possibility of
non-alphabetic characters in that cell.

=IF(LEN(A1)<1,"Too many chars",
IF(OR(CODE(LOWER(A1))<CODE("a"),CODE(LOWER(A1))CO DE("z")),"not alpabetic",
IF(EXACT(A1,UPPER(A1)),"upper","Lower")))

All one cell.

wrote:

Is there a function that will allow me to determine if a character is
either Upper or Lower Case? If not, any idea how I can build one in
VBA?


--

Dave Peterson
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
convert lower to upper case automatically without using UPPER Sal Excel Discussion (Misc queries) 6 July 26th 09 11:27 AM
Changing upper case characters to upper/lower Richard Zignego Excel Discussion (Misc queries) 1 December 17th 07 10:09 PM
Changing file in all upper case to upper and lower case Sagit Excel Discussion (Misc queries) 15 May 30th 07 06:08 AM
Change from mixed caps and upper lower to all upper lower case Fish''s Mermaid Excel Worksheet Functions 3 October 13th 06 02:15 PM
How do I convert all upper case excel sheet into upper and lower . DebDay Excel Discussion (Misc queries) 1 March 9th 05 08:31 PM


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