N
Nasim
Hi, i have a before_print event which does not work and i don't
understand y not. i also can't debug it. i put a break point at the end
sub line and i press f8 but nothing happens and the computer beeps.
would you please help me to understand what i am doing wrog? cell C9 is
a drop down list and codes are in this workbook module. i have
conditional formating for cells that should be filled out by users
according to their dropdown list selection.
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim i As Integer
Dim cell As Range
i = 0
If Sheets(1).Range("c9").Text = "abcd" Then
Sheets(1).Range("c12:c19", "j9", "j11", "i13", "i15", "i17",
"i19").Select
For Each cell In Selection
If IsEmpty(cell) Then
i = i + 1
End If
Next cell
If i > 0 Then
MsgBox "Please fill out all the mandatory fields which are
colored in yellow"
Cancel = True
End If
End If
End Sub
understand y not. i also can't debug it. i put a break point at the end
sub line and i press f8 but nothing happens and the computer beeps.
would you please help me to understand what i am doing wrog? cell C9 is
a drop down list and codes are in this workbook module. i have
conditional formating for cells that should be filled out by users
according to their dropdown list selection.
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim i As Integer
Dim cell As Range
i = 0
If Sheets(1).Range("c9").Text = "abcd" Then
Sheets(1).Range("c12:c19", "j9", "j11", "i13", "i15", "i17",
"i19").Select
For Each cell In Selection
If IsEmpty(cell) Then
i = i + 1
End If
Next cell
If i > 0 Then
MsgBox "Please fill out all the mandatory fields which are
colored in yellow"
Cancel = True
End If
End If
End Sub