Thread: mandatory cell
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default mandatory cell

bta,

Copy the code below, and paste it into the codemodule of the ThisWorkbook object. See

http://www.mvps.org/dmcritchie/excel/event.htm

if you are not familiar with event coding.

This code will require cell A1 of Sheet1 be filled in before the file will be saved.

HTH,
Bernie
MS Excel MVP


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If Worksheets("Sheet1").Range("A1").Value = "" Then
MsgBox "Fill in cell A1 on Sheet1 !!!!"
Cancel = True
MsgBox "File is not saved yet!"
End If
End Sub

wrote in message
...
i want my colleagues to mandatory fill in a cell before saving. is
this possible? (sorry for my poor english)
thanks
bta