#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default cell verification

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 301
Default 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?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 301
Default cell verification

Make the first Msgbox I suggested say "...can be closed..." instead of
"...can be saved..."
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?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Payroll verification hrs and time off Elaine Excel Worksheet Functions 6 August 29th 07 12:40 AM
General Cell Data Verification and Copy... jgbadingerjr Excel Discussion (Misc queries) 3 January 1st 07 10:45 PM
Date verification Oldjay Excel Discussion (Misc queries) 4 October 24th 06 03:52 AM
Data Verification Problem Kristen Excel Discussion (Misc queries) 1 July 17th 06 05:00 PM
data verification Kristen Excel Discussion (Misc queries) 0 July 14th 06 02:31 PM


All times are GMT +1. The time now is 07:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"