Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
you're welcome
regards FSt1 "Jim Lavery" wrote: Brilliant, just what I wanted. thanks very much. Jim "FSt1" wrote in message ... hi yes. but it would be nice to know which cell the leave is in and what the quota is but in it's simplest form, it might look something like this..... leave in A1. quota = 50 Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If Range("A1").Value 50 Then MsgBox "leave exceeds quota. save not allowed" Cancel = True End If End Sub this is workbook code. Alt+F11. in the project window(far left) expand the project(file). double click "ThisWorkbook". paste above code into this workbook module. modify if needed. Regards FSt1 "Jim Lavery" wrote: 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Number Format on Excel File saved from .html file | Excel Discussion (Misc queries) | |||
Saved *.csv file gives SYLK file type warning upon Excel 2003 open | Excel Discussion (Misc queries) | |||
How to tell number of spaces between values in saved text file fromthe original xls file | Excel Discussion (Misc queries) | |||
Stop "Book1" from opening from a saved file | Excel Discussion (Misc queries) | |||
How do I stop today() from updating date on saved spreadsheets? | Excel Discussion (Misc queries) |