I am trying to make sure all of my fields are not left blank before printing. In the example code, the range Values stop the printing but the Elseif statement for the ComboBox1 is not working. Would someone please help me?
Private Sub Workbook_BeforePrint(Cancel As Boolean)
'Check to see if Cells are blank
If Range("H7").Value = "" Then
Cancel = True
MsgBox "The Event Date can not be blank"
ElseIf Range("D9").Value = "" Then
Cancel = True
MsgBox "Your Name can not be blank"
ElseIf Range("D11").Value = "" Then
Cancel = True
MsgBox "Event Name can not be blank"
ElseIf Range("D13").Value = "" Then
Cancel = True
MsgBox "Brand can not be blank"
ElseIf Range("I13").Value = "" Then
Cancel = True
MsgBox "Covered by Supplier can not be blank"
ElseIf Range("D15").Value = "" Then
Cancel = True
MsgBox "Bill Back Contant can not be blank"
ElseIf Sheet1(ActionPlan.ComboBox1.ListIndex) = -1 Then
Cancel = True
MsgBox "Bill Back Contant can not be blank"
End If
End Sub