Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need closure | New Users to Excel | |||
mandatory cell | Excel Discussion (Misc queries) | |||
Mandatory cell | Excel Discussion (Misc queries) | |||
Cell to be mandatory fill in | Excel Discussion (Misc queries) | |||
Check/Tick box's and Mandatory cells | Excel Discussion (Misc queries) |