Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Mandatory Field in Excel 2002
How do you set up a cell to make it a mandatory field so that if anyone fails
to enter a data in a cell or leaves it blank upon closing the worksheet, it would prompt the user to enter data as it is a mandatory field? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Mandatory Field in Excel 2002
One way:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If Sheets("Sheet1").Range("A1").Value = "" Then MsgBox "you must enter data in A1" Cancel = True Sheets("Sheet1").Select Range("A1").Select End If End Sub Mike Mike "Somewhere In Excel 2002" wrote: How do you set up a cell to make it a mandatory field so that if anyone fails to enter a data in a cell or leaves it blank upon closing the worksheet, it would prompt the user to enter data as it is a mandatory field? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Mandatory Field in Excel 2002
I've never been a fan of putting stuff in the workbook_beforeclose event.
If I open the workbook in error (or just don't want to save my changes), are you going to make me enter stuff into the workbook just so I can close it? And if I have to enter stuff in the workbook, are you going to make me save the workbook before I can close it? What happens if I open the workbook and destroy 18 worksheets that are very important. If I try to close it, are you going to force me to save it this way? Personally, I'd try to do something else. I like to add a warning message in a cell based on a formula: =if(somethingisok,"","Warning--xxx and yyy have to be done first!") (formatted in big bold red letters) Then I as a user can see the warning and still be able to close without saving--or close and save and fix at a later time. Somewhere In Excel 2002 wrote: How do you set up a cell to make it a mandatory field so that if anyone fails to enter a data in a cell or leaves it blank upon closing the worksheet, it would prompt the user to enter data as it is a mandatory field? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
mandatory field size within table | Excel Discussion (Misc queries) | |||
mandatory field | Excel Discussion (Misc queries) | |||
How do I create a mandatory field in Excel | Excel Programming | |||
How do I create a mandatory field in Excel | Excel Programming | |||
how do you set up a mandatory field in Excel? | Excel Discussion (Misc queries) |