Workbook_BeforeSave / Cells with required entry / Catch-22
Posted by David Megnin on July 13, 2001 10:11 AM
How do you save your worksheet once you have entered the code below? It seems to cause a catch-22.
Thanks
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Sheets("yourSheet").[a1] = "" Then
Cancel = True
MsgBox "Can't save No entry for A1"
End If
End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As_ Boolean, Cancel As Boolean)
If Sheets("yourSheet").[a1] = "" Then
Cancel = True
MsgBox "Can't save No entry for A1"
End If
End Sub