Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI = False Then
If Me.Worksheets("sheet1").Range("A1").Value > 0 Then
Cancel = True
MsgBox ("Save cancelled. Please fill in all the required fields and try again.")
End If
End If
End Sub
Excel Workbook | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | |||
1 | slot1 | slot2 | slot3 | slot4 | slot5 | slot6 | slot7 | slot8 | CHECK | * | COUNT | ||
2 | ab | * | discs | discs | 123 | Dave | N/A | 8/7/2011 | 0 | * | 1 | ||
3 | test | test | * | * | * | * | * | * | 1 | * | * | ||
4 | * | * | * | * | * | * | * | * | 0 | * | * | ||
Sheet2 |