close

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?

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()