+ Reply to Thread
Results 1 to 4 of 4

VBA code for mandatory cells - only allow to save if complete

  1. #1
    Registered User
    Join Date
    05-30-2014
    Posts
    3

    Question VBA code for mandatory cells - only allow to save if complete

    Hi,

    I'm brand new to using VB and have been playing around with setting up a VBA code for mandatory cells in excel for last few weeks.

    I only managed to get it done for 1 cell but actually i need to apply for multiple cell in sheet.

    Let me try to explain my problem and hopefully someone can give your expertise to resolve it.

    I need a vba code that checks if multiple cells are complete before saving.

    -->I have a template including 1000 rows and 20 columns (A20:O1019). User of the template have to ensure all the blank is filled, meaning that as soon as there is a single cell entry in the Column E (start with E20), all the blank must be filled in (until column N).
    The template only can be saved if an entire row completely filled or remain empty.

    note: column B, C, D, F, J, L are either hidden and/or contain formulas which already been locked and auto populate (Example: when you type in column E, then data in B,C, D, F will be appeared).

    Besides, i have few sheets in 1 document, should i set the same VBA on each sheet or set in one of it will do?

    Would very appreciate any help.

    Regards,
    Lina

  2. #2
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: VBA code for mandatory cells - only allow to save if complete

    Hi,

    Please attached what you have done to single cell. Also, attached expected output.
    I mean what do you want to say by "as soon as there is a single cell entry in the Column E (start with E20), all the blank must be filled in (until column N). "??

    Do you mean I enter in one cell E20 and all other cells until column N gets filled???

    Please elaborate your problem of statement and expected output.

    Regards,
    Paresh J
    Click on "* Add Reputation" as a way to say thanks

  3. #3
    Registered User
    Join Date
    05-30-2014
    Posts
    3

    Red face Re: VBA code for mandatory cells - only allow to save if complete

    sample.xlsx

    Hi Pareshj,

    Thanks for your reply.

    attached is the sample of my file.

    The result should be:

    If the data is completely filled (refer to 1st line), it consider a complete data and allowed to save.
    however, if there is a SAP ID enter (2nd line) but the rest of the field did not fill up, this file can't save.

    Meaning to say, from B20 until N20, they are a mandatory cells (those in purple color) which need to fill up before save.
    It either should be fully filled from B20 to N20 or blank the whole line.

    Those cell with grey color is already pre-fixed where when you key in data in purple cell, the information will automatically prompt out.

    Let me know if i missed out any information.

    Thank you very much in advance on your kind assistance.

  4. #4
    Registered User
    Join Date
    05-30-2014
    Posts
    3

    Re: VBA code for mandatory cells - only allow to save if complete

    Anyone can help? T_T

    Quote Originally Posted by sqinm View Post
    Attachment 329939

    Hi Pareshj,

    Thanks for your reply.

    attached is the sample of my file.

    The result should be:

    If the data is completely filled (refer to 1st line), it consider a complete data and allowed to save.
    however, if there is a SAP ID enter (2nd line) but the rest of the field did not fill up, this file can't save.

    Meaning to say, from B20 until N20, they are a mandatory cells (those in purple color) which need to fill up before save.
    It either should be fully filled from B20 to N20 or blank the whole line.

    Those cell with grey color is already pre-fixed where when you key in data in purple cell, the information will automatically prompt out.

    Let me know if i missed out any information.

    Thank you very much in advance on your kind assistance.

+ 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] Need VBA code for mandatory cells in excel
    By Defect in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 07-19-2016, 08:34 PM
  2. VBA Code for Mandatory fields on multiple tabs
    By e-x-cel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2014, 01:54 AM
  3. Code to mark mandatory fields before save
    By ukhellfire in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-21-2013, 07:28 AM
  4. Mandatory field required message when user skips mandatory fields
    By Bharathi27 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-11-2013, 05:12 AM
  5. Need code to make completion of certain cells mandatory before saving file
    By SBeirne in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-14-2012, 12:04 PM

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