+ Reply to Thread
Results 1 to 6 of 6

Is it Possible

  1. #1
    John
    Guest

    Is it Possible

    Is is possible to determine the number of blank characters entered in a
    cell? What I mean by Blank, is when the user uses the spacebar to clear the
    contents of the cell

    I have used =LEN but that returns a value for all characters blank and
    otherwise.


    Thanks



  2. #2
    Bob Phillips
    Guest

    Re: Is it Possible

    =LEN(A1)-LEN(SUBSTITUTE(A1," ",""))

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "John" <[email protected]> wrote in message
    news:[email protected]...
    > Is is possible to determine the number of blank characters entered in a
    > cell? What I mean by Blank, is when the user uses the spacebar to clear

    the
    > contents of the cell
    >
    > I have used =LEN but that returns a value for all characters blank and
    > otherwise.
    >
    >
    > Thanks
    >
    >




  3. #3
    John
    Guest

    Re: Is it Possible

    Thanks Bob, very very clever


    "Bob Phillips" <[email protected]> wrote in message
    news:[email protected]...
    > =LEN(A1)-LEN(SUBSTITUTE(A1," ",""))
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "John" <[email protected]> wrote in message
    > news:[email protected]...
    >> Is is possible to determine the number of blank characters entered in a
    >> cell? What I mean by Blank, is when the user uses the spacebar to clear

    > the
    >> contents of the cell
    >>
    >> I have used =LEN but that returns a value for all characters blank and
    >> otherwise.
    >>
    >>
    >> Thanks
    >>
    >>

    >
    >




  4. #4
    John
    Guest

    Re: Is it Possible

    One twist on this Bob, is that, is it possible to just count the Blanks to
    the left of the first word. In my cell two words entered are valid but that
    means a blank between the first and second, so I would have to allow that.
    My idea is that when I get a value >0 then I delete the contents of A1, but
    if two words are typed in that would return 1 and in that case I would
    incorrectly delete. Thus blanks before the first word are the entries that
    are invalid


    "John" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks Bob, very very clever
    >
    >
    > "Bob Phillips" <[email protected]> wrote in message
    > news:[email protected]...
    >> =LEN(A1)-LEN(SUBSTITUTE(A1," ",""))
    >>
    >> --
    >>
    >> HTH
    >>
    >> RP
    >> (remove nothere from the email address if mailing direct)
    >>
    >>
    >> "John" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Is is possible to determine the number of blank characters entered in a
    >>> cell? What I mean by Blank, is when the user uses the spacebar to clear

    >> the
    >>> contents of the cell
    >>>
    >>> I have used =LEN but that returns a value for all characters blank and
    >>> otherwise.
    >>>
    >>>
    >>> Thanks
    >>>
    >>>

    >>
    >>

    >
    >




  5. #5
    Harlan Grove
    Guest

    Re: Is it Possible

    "John" <[email protected]> wrote...
    >One twist on this Bob, is that, is it possible to just count the Blanks to
    >the left of the first word. In my cell two words entered are valid but that
    >means a blank between the first and second, so I would have to allow that.
    >My idea is that when I get a value >0 then I delete the contents of A1, but
    >if two words are typed in that would return 1 and in that case I would
    >incorrectly delete. Thus blanks before the first word are the entries that
    >are invalid

    ....

    If you want to eliminate leading spaces and would also accept eliminating
    any trailing spaces and compressing any sequences of multiple spaces between
    words into single spaces, use the TRIM function.

    If you really want just the number of leading spaces, try

    =FIND(LEFT(TRIM(A1),1),A1)-1



  6. #6
    John
    Guest

    Re: Is it Possible

    Thanks Harlan, I can work with that


    "Harlan Grove" <[email protected]> wrote in message
    news:ODc0B0%[email protected]...
    > "John" <[email protected]> wrote...
    >>One twist on this Bob, is that, is it possible to just count the Blanks to
    >>the left of the first word. In my cell two words entered are valid but
    >>that means a blank between the first and second, so I would have to allow
    >>that. My idea is that when I get a value >0 then I delete the contents of
    >>A1, but if two words are typed in that would return 1 and in that case I
    >>would incorrectly delete. Thus blanks before the first word are the
    >>entries that are invalid

    > ...
    >
    > If you want to eliminate leading spaces and would also accept eliminating
    > any trailing spaces and compressing any sequences of multiple spaces
    > between words into single spaces, use the TRIM function.
    >
    > If you really want just the number of leading spaces, try
    >
    > =FIND(LEFT(TRIM(A1),1),A1)-1
    >




+ 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