I assume you want to ensure that a cell is filled out before the
workbook is closed. Open the VBA Editor, display the Project
Window (CTRL+R) and open the ThisWorkbook code module. There,
paste the following code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Worksheets("Sheet1").Range("A1").Value = "" Then
MsgBox "You must fill in A1."
Cancel = True
End If
End Sub
Change the Sheet name and cell reference to meet your needs.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com