Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have an excel sheet that has fields we need to enter, (i.e. zipcode, State,
City), and what I want to know is HOW do I have it "mandatory" to have those fields filled? Meaning if someone only fills 1 out of the 3 fields, then tries to save it, it should prompt something like, "Please fill all fields before saving", or something like that? |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
You would need event code to cancel the save if all three cells were not filled.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI _ As Boolean, Cancel As Boolean) If Application.CountA(Sheets("Sheet1").Range("A1:C1") ) < 3 Then Cancel = True MsgBox "Please fill required cells, save has been cancelled" End If End Sub Note: if user disables macros the above won't run. Gord Dibben MS Excel MVP On Fri, 6 Jun 2008 08:43:02 -0700, Mandatory fields in Excel <Mandatory fields in wrote: I have an excel sheet that has fields we need to enter, (i.e. zipcode, State, City), and what I want to know is HOW do I have it "mandatory" to have those fields filled? Meaning if someone only fills 1 out of the 3 fields, then tries to save it, it should prompt something like, "Please fill all fields before saving", or something like that? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Required fields in Excel | New Users to Excel | |||
How can I fill in the required fields on my spreadsheet? | Excel Discussion (Misc queries) | |||
Required fields with comments | Excel Worksheet Functions | |||
highlighting required fields | Excel Worksheet Functions | |||
Required fields | Excel Discussion (Misc queries) |