Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Mandatory cell check before closure

Is there a way to have mandatory cells that must be
contain data being checked before the document is close
and prompting the user to complete all mandatory cells.

Many Thanks,


Simon
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Mandatory cell check before closure

Hi Simon

You can use the Counta function like this in the Thisworkbook module

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Application.WorksheetFunction.CountA(Sheets("Sheet 1").Range("a1:a10")) < 10 Then
MsgBox "fill in all cells"
Cancel = True
End If
End Sub

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Simon" wrote in message ...
Is there a way to have mandatory cells that must be
contain data being checked before the document is close
and prompting the user to complete all mandatory cells.

Many Thanks,


Simon



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Mandatory cell check before closure

This worked great.

Thank you very much.

Simon


-----Original Message-----
Hi Simon

You can use the Counta function like this in the

Thisworkbook module

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Application.WorksheetFunction.CountA(Sheets

("Sheet1").Range("a1:a10")) < 10 Then
MsgBox "fill in all cells"
Cancel = True
End If
End Sub

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Simon" wrote in

message ...
Is there a way to have mandatory cells that must be
contain data being checked before the document is close
and prompting the user to complete all mandatory cells.

Many Thanks,


Simon



.

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
Need closure CTURNER82 New Users to Excel 3 February 11th 09 09:37 PM
mandatory cell [email protected] Excel Discussion (Misc queries) 1 January 16th 08 05:28 PM
Mandatory cell Jeff Excel Discussion (Misc queries) 13 February 5th 07 04:02 PM
Cell to be mandatory fill in CBrausa Excel Discussion (Misc queries) 13 May 9th 06 11:46 PM
Check/Tick box's and Mandatory cells Libby Excel Discussion (Misc queries) 2 January 21st 05 01:07 PM


All times are GMT +1. The time now is 07:00 PM.

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"