+ Reply to Thread
Results 1 to 14 of 14

How to restrict users from keeping cells empty with spaces

  1. #1
    Forum Contributor
    Join Date
    03-26-2021
    Location
    California, US
    MS-Off Ver
    MS Office 2010
    Posts
    105

    How to restrict users from keeping cells empty with spaces

    Friends!

    I hope everyone is great and enjoying life.

    So, I have this form where users can fill out cells, as in a form.

    Unintentionally, some users type in spaces into cells which makes it difficult for me to use.

    I want users to type in names, numbers, or dates into cells, but not type in spaces.

    Of course, there are spaces between names and numbers, which is fine with me, but I mean to type in several spaces and then press enter. This also includes typing in spaces before names and numbers.

    For example:
    This is a correct way to type. (No spaces in the beginning)

    Not:
    This is not a correct way. (Space before text or beginning.)

    Or:
    (All spaces, empty)

    As you can see the difference of what I mean.

    The other thing that bugs me is that not typing in from left cells to right, or simply, left to right. It has to be filled out from first the left cell and then continue to the right cells. Then starts the second row and so on.

    Anyways, to make long story short, I have so far restricted users from just typing in anywhere into the form.

    What I have done is to start from the top and then continue to the right by using data validation.

    However, the issue is with what I have done is that you can type in a text or value then continue where ever you want, even below in the column.

    Please see the attached excel file that I have prepared but it is clearly not in accordance of what I am requesting.

    Please if you guys can help me out with this, that would greatly appreciated!

    Thank you very much in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,290

    Re: How to restrict users from keeping cells empty with spaces

    =
    Please Login or Register  to view this content.
    Maybe this datavalidation will work
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  3. #3
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,039

    Re: How to restrict users from keeping cells empty with spaces

    Another option is: =AND(COUNTIF(A3:$A$3,"")=0,LEN(TRIM(A3))=LEN(A3)), ensure no leading spaces, trailing spaces or double spaces between texts.

  4. #4
    Forum Contributor
    Join Date
    03-26-2021
    Location
    California, US
    MS-Off Ver
    MS Office 2010
    Posts
    105

    Re: How to restrict users from keeping cells empty with spaces

    =AND(COUNTIF(A3:$A$3,"")=0,LEFT(A3,1)<>" ")

    Yes, this works great for the spacing issue, thank you so much!

    However, I am still able to start a new row without having to fill out the first row to the end completely.

    What I want is for the users to fill out the first row before going onto the second. Then, second row must be completed before starting with the third and so on.

    I hope I am making sense.

    Otherwise, it looks great!

  5. #5
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,039

    Re: How to restrict users from keeping cells empty with spaces

    Try this, =AND(COUNTIF($A$3:A3,"")=0,COUNTIF($A2:$G2,"")=0,LEN(TRIM(A3))=LEN(A3))

  6. #6
    Forum Contributor
    Join Date
    03-26-2021
    Location
    California, US
    MS-Off Ver
    MS Office 2010
    Posts
    105

    Re: How to restrict users from keeping cells empty with spaces

    Perfect!

    Great job, man!

    Loved it!
    Last edited by AliGW; 11-06-2022 at 04:45 AM. Reason: Please DON'T quote unnecessarily!

  7. #7
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,039

    Re: How to restrict users from keeping cells empty with spaces

    Glad to help! Thanks for the Rep!

  8. #8
    Forum Contributor
    Join Date
    03-26-2021
    Location
    California, US
    MS-Off Ver
    MS Office 2010
    Posts
    105

    Re: How to restrict users from keeping cells empty with spaces

    Quote Originally Posted by josephteh View Post
    Try this, =AND(COUNTIF($A$3:A3,"")=0,COUNTIF($A2:$G2,"")=0,LEN(TRIM(A3))=LEN(A3))
    I just have one more question, please, if you do not mind, really.

    I have added some lists from where the user can select from through data validation.

    But, now, I cannot apply this formula because it asks me remove the list first before applying a new formula.

    Could you please, please help me out here?

    Please!
    Attached Files Attached Files

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: How to restrict users from keeping cells empty with spaces

    Since columns D to G are no longer free entry values, amend the DV formula to read:
    =AND(COUNTIF($A$3:A3,"")=0,COUNTIF($A2:$C2,"")=0,LEN(TRIM(A3))=LEN(A3))

    and apply it ONLY to columns A to C.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  10. #10
    Forum Contributor
    Join Date
    03-26-2021
    Location
    California, US
    MS-Off Ver
    MS Office 2010
    Posts
    105

    Re: How to restrict users from keeping cells empty with spaces

    But I want the first row to be fully filled in/selected from the list before continuing onto the next rows.

    Is that somehow possible?

    All rows must be completed before continuing on the next rows.
    Last edited by AliGW; 11-06-2022 at 04:45 AM. Reason: Please DON'T quote unnecessarily!

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: How to restrict users from keeping cells empty with spaces

    And if you use JT's formula, but only apply it as the DV in columns A to C it seems perfect to me??...
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    03-26-2021
    Location
    California, US
    MS-Off Ver
    MS Office 2010
    Posts
    105

    Re: How to restrict users from keeping cells empty with spaces

    omg, Yes!

    I don't know why it didn't work before.

    I am really sorry.

    Thank you so much, man!

    But sorry for wasting time when I should have just paid a little more attention.

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: How to restrict users from keeping cells empty with spaces

    Maybe you'd applied it to all of the columns, as far out as G, perhaps?

    BtW - nice formula josephteh... I'd looked at this yesterday and didn't see a way forward. have some rep!

  14. #14
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,039

    Re: How to restrict users from keeping cells empty with spaces

    Thanks for the rep, Glenn!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Spaces in empty cells
    By JK37 in forum Excel General
    Replies: 4
    Last Post: 05-11-2022, 03:24 PM
  2. [SOLVED] Check range of cells in column if not null/empty then restrict save and show message
    By gmalpani in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-07-2020, 09:25 AM
  3. [SOLVED] VBA - Restrict Cells to Certain Users and Macros
    By Rich789 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2018, 11:55 AM
  4. [SOLVED] How Can I: Remove Spaces from Empty Cells, When Concatenating?
    By Sandcastle in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-06-2016, 03:22 PM
  5. [SOLVED] Empty Cells apparently have spaces
    By Sam Capricci in forum Access Tables & Databases
    Replies: 13
    Last Post: 03-02-2015, 12:55 PM
  6. How to restrict users to only editting certain cells?
    By PeruvianSkies in forum Excel General
    Replies: 2
    Last Post: 04-06-2009, 11:29 AM
  7. [SOLVED] restrict users
    By Restricted user access for exel workbook in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-15-2006, 11:30 AM

Tags for this Thread

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