cell verification
Right-click the excel LOGO near the File menu, select View code, paste this
in:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Application.CountA(Sheets("Sheet1").Range("N:N")) <
Application.CountA(Sheets("Sheet1").Range("O:O")) Then
Cancel = True
MsgBox "Before this file can be saved, each item in column N must
have a reason in column O.", vbExclamation
End If
End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If Application.CountA(Sheets("Sheet1").Range("N:N")) <
Application.CountA(Sheets("Sheet1").Range("O:O")) Then
Cancel = True
MsgBox "Before this file can be saved, each item in column N must
have a reason in column O.", vbExclamation
End If
End Sub
Bob Umlas
Excel MVP
"Firkins" wrote in message
...
I have a sheet that when users input data in column N they need to put a
reason in column O. How can I ensure that the reason in entered in column
O
before they save and close?
|