+ Reply to Thread
Results 1 to 3 of 3

How to get VBA Data Validation pop-up message if cell in named range is empty

Hybrid View

AmyB2108 How to get VBA Data... 06-14-2016, 02:11 PM
JBeaucaire Re: How to get VBA Data... 06-14-2016, 04:41 PM
AmyB2108 Re: How to get VBA Data... 06-14-2016, 05:08 PM
  1. #1
    Registered User
    Join Date
    03-28-2016
    Location
    NH
    MS-Off Ver
    2013
    Posts
    2

    Question How to get VBA Data Validation pop-up message if cell in named range is empty

    Hi all - VERY new to VBA and Macros; any help you can give me is appreciated! This seems so simple but is not working for me...

    I am trying to get a pop-up message "Please answer all questions" IF any cell in named range "Responses" is empty
    If not will run remaining Submit_Responses macro

    Current Macro:
    Sub Submit_Responses()
    '
    ' Submit_Responses Macro
    '
        Range("K25:L26").Select
        With Selection.Font
            .ThemeColor = xlThemeColorAccent4
            .TintAndShade = 0
        End With
        Range("A1").Select
    End Sub
    ~ Thank you in advance!!
    Last edited by AmyB2108; 06-14-2016 at 04:07 PM. Reason: Updated Title

  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 get VBA Data Validation pop-up message if cell in named range is empty

    Something like this, maybe"

    Sub Submit_Responses()
    Dim Cell as Range
    
    For Each cell in Range("K25:L26")
       If Len(Cell) =0 Then
            Cell.Select
            MsgBox "Please answer all questions."
            Exit Sub
        End If
    Next Cell
        'Code here to do the "submit" actions if all cells are filled in
    End Sub
    Last edited by JBeaucaire; 06-14-2016 at 05:31 PM.
    _________________
    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
    03-28-2016
    Location
    NH
    MS-Off Ver
    2013
    Posts
    2

    Thumbs up Re: How to get VBA Data Validation pop-up message if cell in named range is empty

    Thank you so very much JBeaucaire!

    I even learned about the For Next requirement and this worked perfectly!

+ 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] If cell is empty in a variable range, stop macro and return error message
    By Andrei Kononenko in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-22-2019, 02:19 PM
  2. Replies: 9
    Last Post: 03-24-2017, 03:39 PM
  3. Data Validation with cell reference message
    By Axmed.cm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-24-2016, 12:22 AM
  4. [SOLVED] Input message into cell from a cell in another sheet using data validation
    By keineko in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2015, 12:31 PM
  5. Data validation - intgers bigger than 0 and empty cell not allowed
    By fibonacci1101 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-31-2013, 04:51 PM
  6. Data Validation List: No empty or blank cell values
    By SiLeNCeD in forum Excel General
    Replies: 0
    Last Post: 11-14-2012, 06:41 PM
  7. Data Validation – Non empty cell
    By Abhijit2011 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-07-2011, 09:49 AM

Tags for this Thread

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