+ Reply to Thread
Results 1 to 19 of 19

MACRO to check validation dropdowns left blank

Hybrid View

  1. #1
    Registered User
    Join Date
    10-27-2008
    Location
    Manila, Philippines
    Posts
    11
    Thanks a lot guys.

    I'll give a try tomorrow

  2. #2
    Registered User
    Join Date
    10-27-2008
    Location
    Manila, Philippines
    Posts
    11

    Question

    Hi again,

    Tried the new code - this time no syntax error. Good.
    However when I run the code, even if the range or cell with validation is no longer blank the Msgbox indicating there is a blank still pops out and the copying does not proceed.

    I'd like to place the code here plus the copying code I recorded but don't know how to wrap the code.

    Thanks

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Just checked your code, try this instead

    Option Explicit
    
    Sub IdentifyBlanksinDataValidation()
        Dim msg    As String
        On Error GoTo NoBlank
        If Application.WorksheetFunction.CountBlank(Range("d6:e6")) > 0 Then
            msg = "CA NAME cannot be blank"
            GoTo isblank
        End If
        If IsEmpty(Range("d17")) Then
            msg = "Process Type cannot be blank"
            GoTo isblank
        End If
        If IsEmpty(Range("d18")) Then
            msg = "Sub Type cannot be blank"
            GoTo isblank
        End If
        If IsEmpty(Range("d20")) Then
            msg = "Product/Specific Type cannot be blank"
            GoTo isblank
        End If
        Range("S2:AF2").Copy
        Sheets("Raw_Data").ange("A5").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                                                                                            :=False, Transpose:=False
        Application.CutCopyMode = False
        Rows("5:5").Insert Shift:=xlDown
        Sheets("Tracker").Range("D10:D11,D13:D15,D17:D20,B23:F32").ClearContents
           
    isblank:
        MsgBox msg, vbCritical, "Input missing"
        Exit Sub
    End Sub
    Last edited by royUK; 10-29-2008 at 10:04 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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