+ Reply to Thread
Results 1 to 8 of 8

Mandatory Cells

  1. #1
    Registered User
    Join Date
    07-10-2007
    Posts
    4

    Mandatory Cells

    Hi I have a spreadsheet which I'm using a as a form for people to fill in order requests. I have a problem where people don't always input information in the required cells and other times they put in the wrong information. I've solved that latter by using drop down lists, however i would like to make several cells mandatory. In that I mean they can't leave them blank and are prevented from saving the form. Some of the mandatory cells will have drop down lists and others just require something entered into the cells. Finally most of the cells are actualy 2 or three merged together. I can change this if merged cells are a problem. I've seen some VBA scripts but none seem to work and I should point out that I'm no VB guru.

    Can anyone help me out please?

    Kind regards,

  2. #2
    Registered User
    Join Date
    08-27-2003
    Location
    Melbourne, Australia
    Posts
    75
    You could try having the cells checked before saving.
    With macros opened, double click on "This Workbook" (left hand side)
    With the window that opens, in the left drop down box, select "Workbook"
    Then in the right hand one, select "Before Save"
    Then, have code check the relative cells, and if the cells are empty (or incorrect), cancel the save procedure.

  3. #3
    Registered User
    Join Date
    07-10-2007
    Posts
    4
    Thank you Paul,

    Unfortunately you are talking double dutch to me. Do you have a script that I can cut and paste into the VBA window?

  4. #4
    Registered User
    Join Date
    08-27-2003
    Location
    Melbourne, Australia
    Posts
    75
    Okay, see file attached.

    This checks 3 cells to ensure they're not empty.
    If any are, it gives you an error message and you can't save the sheet.
    Similar events can happen before printing etc.

    You could also easilyget the code to check for the type of input.
    Please Login or Register  to view this content.
    Cheers,

    Paul

  5. #5
    Registered User
    Join Date
    08-27-2003
    Location
    Melbourne, Australia
    Posts
    75
    Sorry, think the file dropped off. Here 'tis
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-10-2007
    Posts
    4
    Thank you Paul, that works fantastic.

  7. #7
    Registered User
    Join Date
    10-11-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: Mandatory Cells

    I have the same problem. However, now that I put the code in, of course I can't save the document because I left the cells blank.

    Is there any way I can save it with the cells blank, and next time I open the document to prompt me to the error if I try to save and certain cells are blank?

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Mandatory Cells

    denisirio,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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