+ Reply to Thread
Results 1 to 2 of 2

Mandatory Cells and Return Values

Hybrid View

  1. #1
    Registered User
    Join Date
    08-05-2013
    Location
    Indiana
    MS-Off Ver
    Excel 2007
    Posts
    2

    Mandatory Cells and Return Values

    Have a spreadsheet that I require a clerk to fill out for border customs for each shipment to Canada (last week my clerk sent a truck to customs with NO QUANTITIES on the paperwork...). Basically, they keep forgetting to fill in necessary information. I want to force them to put information in cells H30:H40- and if they fail to enter information, I want the return message to give a value of the specific part number they failed to include a quantity with.

    Part Number, Qty
    1, 10
    2,
    3, 20

    So in this example I would like the MsgBox to say "You must input Quantities for 2 before Printing"


    Hope this makes sense. Thanks for the help folks.
    Last edited by FaureciaMO; 08-05-2013 at 10:19 AM. Reason: Format

  2. #2
    Registered User
    Join Date
    08-05-2013
    Location
    Indiana
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Mandatory Cells and Return Values

    Here is what I have so far:

    Private Sub Workbook_BeforePrint(Cancel As Boolean)

    If Cells(30, 8).Value = "" Then
    MsgBox "You must input Quatities before Printing"
    Cancel = True
    End If
    If Cells(31, 8).Value = "" Then
    MsgBox "You must input Quanties for"
    Cancel = True
    End If
    If Cells(32, 8).Value = "" Then
    MsgBox "You must input ALL Quantities before Printing"
    Cancel = True
    End If
    If Cells(33, 8).Value = "" Then
    MsgBox "You must input ALL Quantities before Printing"
    Cancel = True
    End If
    If Cells(34, 8).Value = "" Then
    MsgBox "You must input ALL Quantities before Printing"
    Cancel = True
    End If
    If Cells(35, 8).Value = "" Then
    MsgBox "You must input ALL Quantities before Printing"
    Cancel = True
    End If
    If Cells(36, 8).Value = "" Then
    MsgBox "You must input ALL Quantities before Printing"
    Cancel = True
    End If
    If Cells(37, 8).Value = "" Then
    MsgBox "You must input ALL Quantities before Printing"
    Cancel = True
    End If
    If Cells(38, 8).Value = "" Then
    MsgBox "You must input ALL Quantities before Printing"
    Cancel = True
    End If
    If Cells(39, 8).Value = "" Then
    MsgBox "You must input ALL Quantities before Printing"
    Cancel = True
    End If
    If Cells(40, 8).Value = "" Then
    MsgBox "You must input ALL Quantities before Printing"
    Cancel = True
    End If

    End Sub


    This works fine; however, I need to return the cell value(s) for the relevant cells in the return message.

+ 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. Replies: 1
    Last Post: 07-03-2013, 12:14 AM
  2. Mandatory field required message when user skips mandatory fields
    By Bharathi27 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-11-2013, 05:12 AM
  3. Replies: 2
    Last Post: 11-12-2012, 06:26 AM
  4. Adding cells with values but if cells do not have values then return blank
    By jonnykhan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-13-2012, 12:07 PM
  5. [SOLVED] Mandatory Cells
    By Mel1221 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-05-2006, 05:10 PM

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