+ Reply to Thread
Results 1 to 3 of 3

Pop-Up Message if Cell not completed

Hybrid View

  1. #1
    Registered User
    Join Date
    12-12-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003 and Excel 2007, Excel 2011 (Mac)
    Posts
    1

    Pop-Up Message if Cell not completed

    Hi,

    I need to add a pop-up message (which stops a macro running), when certain cells are not completed - in EXCEL 2003.

    All the cells are validation drop-downs so I can add a message if the wrong thing is entered but not if it's not been updated at all.

    The trigger for the message should be when a macro is run to warn the user that the spreadsheet is not complete.

    Does anyone know how to do this?

    The code in the macro is currently:
    '
       ActiveSheet.Unprotect
        Sheets("Data Sets").Visible = True
        Sheets("Data for CS").Select
        Columns("B:E").Select
        Selection.Delete Shift:=xlToLeft
        Sheets("Data Sets").Select
        Selection.AutoFilter Field:=5, Criteria1:="TRUE"
        Range("B2:E32").Select
        Selection.Copy
        Sheets("Data for CS").Select
        Range("B2").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
            SkipBlanks:=False, Transpose:=False
        Columns("B:E").Select
        Columns("B:E").EntireColumn.AutoFit
        Sheets("Data Sets").Select
        Selection.AutoFilter Field:=5
        Application.CutCopyMode = False
        ActiveWindow.SelectedSheets.Visible = False
        Range("B2:E32").Select
        Sheets("Input").Select
        ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
        Sheets("Data for CS").Select
    End Sub
    Many Thanks!

    Richard
    Last edited by davesexcel; 12-14-2012 at 05:42 AM. Reason: Code tags required, please read the forum rules

  2. #2
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Pop-Up Message if Cell not completed

    Guess you want the pop up message before this macro is executed. You can write a simple code just after your macro Sub ...() line, to check if a particular cell value is blank.

    If Range("A1").Value = "" Then ' Change A1 to any cell reference, you can paste this line as many number of time for each cell you want
    Msgbox "Required details are not filled" 'To pop up a message box'
    Exit Sub 'To stop macro and exit
    Endif

  3. #3
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    935

    Re: Pop-Up Message if Cell not completed

    You can also use "Or" if there are more cells to check.
    If Range("A3") = "" Or Range("B5") = "" ... and so on ... Then
        MsgBox "Missing data"
        Exit Sub
    End If
    Last edited by rollis13; 12-14-2012 at 07:11 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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