View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Excel Spreadsheet - Mandatory fields

You could put something in the BeforeClose event

Private Sub Workbook_BeforeClose(Cancel As Boolean)

With Worksheets("Sheet1")
If .Range("A1").Value = "" Then
MsgBox "Value not supplied"
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 Phillips

(remove nothere from email address if mailing direct)

"Mike in Philly" <Mike in wrote in message
...
Is there a way to make an Excel spreadsheet not be able to close unless
certain fields are filled in?