Is there a way to make an Excel spreadsheet not be able to close unless
certain fields are filled in?
You could put something in the BeforeClose event
Private Sub Workbook_BeforeClose(Cancel As Boolean)
With Worksheets(quot;Sheet1quot;)
If .Range(quot;A1quot;).Value = quot;quot; Then
MsgBox quot;Value not suppliedquot;
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)
quot;Mike in Phillyquot; lt;Mike in gt; wrote in message
...
gt; Is there a way to make an Excel spreadsheet not be able to close unless
gt; certain fields are filled in?
- Jan 24 Wed 2007 20:35
Excel Spreadsheet
close
全站熱搜
留言列表
發表留言
留言列表

