Just break it down al litle more to:Code:Sub test() If Range("W17") = Empty Then 'Checks if there is a delivery date. MsgBox "Please add a delivery date!", vbInformation, "Delivery date..." Range("W17").Select Exit Sub End If If Range("W17").Value < Date Then answer = MsgBox("The delivery date is set in the past." & vbNewLine & "Click OK if date is correct." & vbNewLine & "Click Cancel to change.", vbQuestion + vbOKCancel, "Delivery date!") If answer = vbCancel Then Range("W17").Select Exit Sub End If End If If Range("AX17") = Empty Then 'Checks if there is who processed invoice. MsgBox "Please select Processed By!", vbInformation, "Processed by..." Range("AX17").Select Else If Range("AZ73").Value = 0 Then MsgBox "Invoice cannot be £0.00!", vbInformation, "Invoice total..." 'Checks invoice total must be greater than 0. Exit Sub End If Application.ActivePrinter = "doPDF v7 on DOP7:" 'Selects doPDF to genarate PDF file of invoice. ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ "E:\Lusa\Generated Invoices\INV" & Range("L17").Text & ".pdf", _ Quality:=xlQualityStandard, IncludeDocProperties:=False, IgnorePrintAreas _ :=False, OpenAfterPublish:=False If Application.Dialogs(xlDialogPrinterSetup).Show Then End If End If End Sub




Reply With Quote
Bookmarks