Please edit your post and put your VBA into CODE tags -- use the # icon.
The problem you have is that for ex. BL3 value > 0 but DO927 is = 0 then the Cancel will be set to False, ie file saved.
You should think about leaving the tests as and when a Cancel = True is established... ie
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
With Worksheets("Protected Data")
If .Range("BL3").Value > 0 Then
MsgBox "YOU MUST ENTER AN EXPLANATION FOR ANY RECOMMENDATION ABOVE THE GUIDELINES LIMITS"
Cancel = True
Exit Sub
End If
If .Range("DP3").Value > 0 Then
MsgBox "ONE-UP RATING MUST BE ENTERED FOR ALL EMPLOYEES WITH A RECOMMENDATION"
Cancel = True
Exit Sub
End If
If .Range("DO927").Value > 0 Then
MsgBox "YOU MUST ENTER A COUNTRY FOR ALL CONTRIBUTIONS YOU ARE MAKING TO OTHER BU'S"
Cancel = True
Exit Sub
End If
End With
End Sub
Bookmarks