Determine whether a character is Upper or Lower case

  • Thread starter Thread starter mikesalemi
  • Start date Start date
M

mikesalemi

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?
 
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
 
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))>CODE("z")),"not alpabetic",
IF(EXACT(A1,UPPER(A1)),"upper","Lower")))

All one cell.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top