Stop file being saved
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
With Worksheets("Sheet1").Range("A1")
If .Value < 5 Then
msgbobx "Value must be = 5"
Cancel = True
End If
End With
End Sub
'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code
--
__________________________________
HTH
Bob
"Jim Lavery" wrote in message
...
Is there an code that would stop an excel file being saved if a certain
number was exceeded.
Example:- entering leave which exceeds the quota thus stoppping the user
saving the file.
|