+ Reply to Thread
Results 1 to 13 of 13

Force cells to be filled before file can be saved

  1. #1
    Forum Contributor
    Join Date
    06-26-2014
    Location
    Houston
    MS-Off Ver
    365
    Posts
    201

    Force cells to be filled before file can be saved

    Good Afternoon,

    Is there a way to force a user to fill out certain cells, they use data validation, or they cannot save the file? I guess pop up a msg saying you must fill out blah blah before you can save.

    Thanks!

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Force cells to be filled before file can be saved

    Hello dw_22801,

    Yes. It can be done, but then we need to know which Cells require mandatory data.

    Please attach a sample workbook (not a picture or pasted copy).

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Forum Contributor
    Join Date
    06-26-2014
    Location
    Houston
    MS-Off Ver
    365
    Posts
    201

    Re: Force cells to be filled before file can be saved

    Thanks! The Lease Deal Sheet tab is the one that requires info. Just the brown highlighted fields should be required. You will see there is some code that allows populating in the drop downs, so I would like that to stay. Also, can all fields be cleared out once it closes, too? So each time its opened, the user has to enter the info from the beginning? So in summary, can we require each brown field to be filled out, if not, then a msg box tells them to fill out all required fields, and they cannot save the file. Then once they have filled out, when they close the sheet, all of the fields are cleared?


    Thanks!
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Force cells to be filled before file can be saved

    Code for workbook Event

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 02-07-2019 at 04:42 AM.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Forum Contributor
    Join Date
    06-26-2014
    Location
    Houston
    MS-Off Ver
    365
    Posts
    201

    Re: Force cells to be filled before file can be saved

    That's great! Can we have the following events? Can we have it where once an attempt to close happens, and Yes to save is hit, the msg box comes up as it does, but also it doesn't actually close at that point. So it only closes when No to save is chosen?

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Force cells to be filled before file can be saved

    Revised code

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 02-07-2019 at 11:46 AM.

  7. #7
    Forum Contributor
    Join Date
    06-26-2014
    Location
    Houston
    MS-Off Ver
    365
    Posts
    201

    Re: Force cells to be filled before file can be saved

    Awesome! Not sure if I'm missing something, but should it be clearing out all the fields when it closes? Basically I am trying to force the user to enter all of the information from blank fields each time they open it in order to reduce instances of wrong info. I don't want them to be able to leave info from a previous sheet. They basically create one of these for each new contract we do and send a copy out. Thanks for your help!

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Force cells to be filled before file can be saved

    Hello dw_22801,

    I am now totally confused, as you state in Post#3,
    Also, can all fields be cleared out once it closes, too? So each time its opened, the user has to enter the info from the beginning? So in summary, can we require each brown field to be filled out, if not, then a msg box tells them to fill out all required fields, and they cannot save the file. Then once they have filled out, when they close the sheet, all of the fields are cleared?
    And now you ask,
    Awesome! Not sure if I'm missing something, but should it be clearing out all the fields when it closes?

  9. #9
    Forum Contributor
    Join Date
    06-26-2014
    Location
    Houston
    MS-Off Ver
    365
    Posts
    201

    Re: Force cells to be filled before file can be saved

    When I close out the sheet, the fields are not clearing, but that is what I was hoping to do. It opens up and the same info is in each field.

  10. #10
    Forum Contributor
    Join Date
    06-26-2014
    Location
    Houston
    MS-Off Ver
    365
    Posts
    201

    Re: Force cells to be filled before file can be saved

    I guess I phrased the second question incorrectly. I am wanting it to clear out the fields, but the last sheet I tried was not doing that.

  11. #11
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Force cells to be filled before file can be saved

    Hello dw_22801,

    Expanding on what kvsrinivasamurthy had given you, please replace this Code below;

    Please Login or Register  to view this content.
    With this Code;

    Please Login or Register  to view this content.
    And tell me it is working now.

    Regards.

  12. #12
    Forum Contributor
    Join Date
    06-26-2014
    Location
    Houston
    MS-Off Ver
    365
    Posts
    201

    Re: Force cells to be filled before file can be saved

    Close. It looks like when it is saved successfully and closed, the fields aren't cleared. Can that happen too? So the sheet never opens with info in the fields?

  13. #13
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Force cells to be filled before file can be saved

    Hello dw_22801,

    So the sheet never opens with info in the fields?
    To accomplish that, we simply add the Code below;

    Please Login or Register  to view this content.
    Play around with the attached sample Workbook now, and enjoy!

    Regards.
    Attached Files Attached Files

+ 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. File closing after certain cells are filled
    By Doobie1986 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-01-2017, 08:20 PM
  2. How can I force an AngluarJS form to realize required fields have been filled?
    By ZigZigZig in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-01-2015, 03:54 PM
  3. force saved file to have a new file name
    By jerry 6626 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-06-2013, 02:51 PM
  4. [SOLVED] Select only filled cells of a column and create a text file
    By Sam9 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-03-2013, 08:27 AM
  5. Replies: 2
    Last Post: 12-28-2012, 09:55 AM
  6. data in cells saved into file name
    By JASON38967 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-13-2009, 02:45 PM
  7. [SOLVED] Can i reduce my file that's 29 MB but filled with blank cells?
    By zapadias in forum Excel General
    Replies: 3
    Last Post: 08-18-2005, 09:05 AM

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