+ Reply to Thread
Results 1 to 3 of 3

Macro to make multiple cells mandatory - Excel 2007

  1. #1
    Registered User
    Join Date
    Manchester, England
    MS-Off Ver
    Excel 2007

    Macro to make multiple cells mandatory - Excel 2007

    Hi - wondered if anyone could help?

    I have a template that multiple members of our team are going to fill in and save but I wanted to make sure all the necessary cells are filled in. Basically I need cells C4:C6 and F4:F6 to be mandatory at all times and on rows 9 to 13, if column B is filled in then columns C, D & E must also be filled in. i.e If B9 if populated then C9:E9 must be mandatory.

    I have attached the sheet I am working on if it helps. Apologies if this has been covered in a previous thread but I had a look through and any coding I found did not work when I copied it into VBA.

    Many thanks.

    Missed RI Checker.xlsm

  2. #2
    Forum Expert
    Join Date
    The Netherlands
    MS-Off Ver
    Office 365

    Re: Macro to make multiple cells mandatory - Excel 2007

    for your first question

    =if(counta(C4:D6,F4:F6)<6,"wrong input","your formula")

    P.s. I noticed you used merged cells.

    My advice to you would be, don't use merged cells, you get in trouble with it sooner or later.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac

    Re: Macro to make multiple cells mandatory - Excel 2007


    See the attached for my usual approach to this sort of thing.

    I've used helper columns I & J (which you can hide in the production workbook) to record whether the mandatory cells are complete or not. If complete then they all return zero. For additional information I've also used a conditional format so that incomplete cells are coloured light yellow.

    I've named the I2 cell "Check" so all you need do in any macro is read the value of this cell and take action accordingly. e.g.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ 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. Make several cells mandatory if a cell in a range is filled out
    By steeveho in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-18-2013, 06:49 AM
  2. 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
  3. How to make data in cells mandatory?
    By r.kondapalli in forum Excel General
    Replies: 8
    Last Post: 01-18-2011, 11:30 AM
  4. Macro to make cell mandatory
    By nukecity83 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-14-2009, 04:08 AM
  5. To make several cells mandatory based on other cell input.
    By nukecity83 in forum Excel General
    Replies: 1
    Last Post: 10-13-2009, 05:35 PM

Tags for this Thread


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