+ Reply to Thread
Results 1 to 3 of 3

Determine whether a character is Upper or Lower case

  1. #1

    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. #2
    Jim Thomlinson
    Guest

    RE: 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


    "[email protected]" 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. #3
    Dave Peterson
    Guest

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

    All one cell.

    [email protected] 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1