+ Reply to Thread
Results 1 to 9 of 9

How to create an error message if cell left blank

  1. #1
    Registered User
    Join Date
    06-09-2009
    Location
    Tewksbury, MA
    MS-Off Ver
    Excel 2003
    Posts
    9

    How to create an error message if cell left blank

    I am looking for a way to generate an error message if a particular cell in my spreadsheet is left blank. Does anyone have a suggestion?

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to create an error message if cell left blank

    When do you want this message to appear? When the sheet is saved?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    06-09-2009
    Location
    Tewksbury, MA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: How to create an error message if cell left blank

    Yes. I tried the method below but excel is not allowing me to save the worksheet since the cell is blank. It is basically a form that I need another user to fill out and there is a required field. Thank you for your help.

    I tried:
    Open the VBA Editor, display the Project Window (CTRL+R) and open the ThisWorkbook code module. There, paste the following code:

    Please Login or Register  to view this content.
    Last edited by Jeanne; 06-09-2009 at 01:41 PM.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to create an error message if cell left blank

    First, be SURE you know the Forum Rules. One of the most strictly enforced rule around here relates to posting code. You MUST wrap code in
    Please Login or Register  to view this content.
    Go back to that last post, click EDIT > GO ADVANCED, highlight the code, then click the # icon.

    ========
    Do that real quick, then I'll show you the trick you need to save your sheet with that macro in it. Your macro appears perfect for the job.

  5. #5
    Registered User
    Join Date
    06-09-2009
    Location
    Tewksbury, MA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: How to create an error message if cell left blank

    oops! done - thank you!

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to create an error message if cell left blank

    when message appears use ctrl+break
    click end you can then close the workbook
    most users wont know that
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  7. #7
    Registered User
    Join Date
    06-09-2009
    Location
    Tewksbury, MA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: How to create an error message if cell left blank

    Thank you both- I will give it a try!

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to create an error message if cell left blank

    oops JB was that your trick ? didnt see that bit of post!

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to create an error message if cell left blank

    Ok, just click on the DESIGN MODE button on the Control Toolbox toolbar. While in Design Mode, macros aren't running.

    Save your sheet.

    =========
    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

+ 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