I am trying to prevent someone from printing an excel form unless they have filled in all the necessary fields.
The part I am stuck on is with drop down menu's I do not know how it reads the return.
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim oCell As Range
Dim NoBlanks As Range
Set NoBlanks = ActiveSheet.Range("c15")
For Each oCell In NoBlanks
If oCell.Value = "" Then
Cancel = True
MsgBox "Not all required cells have been filled", vbCritical + vbOKOnly, "Error"
Exit Sub
End If
Next
End Sub
That's my Code I've also tried
If oCell.Value = "Select Action Required From Drop Down" Then
As the statement Select Action Required From Drop Down is the default statement in that drop down menu (not blank). Neither restricts printing.
C15 is the cell in which the drop down menu is located.
Bookmarks