summaryrefslogtreecommitdiff
path: root/helpcontent2/source/text/scalc/guide/validity.xhp
blob: 3282a25c27c69aac0d910af7239a90839529647c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************************
 *
 *  OpenOffice.org - a multi-platform office productivity suite
 *
 *  $RCSfile: validity.xhp,v $
 *
 *  $Revision: 1.6 $
 *
 *  last change: $Author: obo $ $Date: 2006-03-28 13:29:05 $
 *
 *  The Contents of this file are made available subject to
 *  the terms of GNU Lesser General Public License Version 2.1.
 *
 *
 *    GNU Lesser General Public License Version 2.1
 *    =============================================
 *    Copyright 2005 by Sun Microsystems, Inc.
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License version 2.1, as published by the Free Software Foundation.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 *
 *    You should have received a copy of the GNU Lesser General Public
 *    License along with this library; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *    MA  02111-1307  USA
 *
 ************************************************************************-->
	
<helpdocument version="1.0">
<meta>
<topic id="textscalcguidevalidityxml" indexer="include" status="PUBLISH">
<title id="tit" xml-lang="en-US">Validity of Cell Contents</title>
<filename>/text/scalc/guide/validity.xhp</filename>
</topic>
<history>
<created date="2003-10-31T00:00:00">Sun Microsystems, Inc.</created>
<lastedited date="2005-02-01T09:43:47">converted from old format - fpe</lastedited>
</history>
</meta>
<body>
<bookmark xml-lang="en-US" branch="index" id="bm_id3156442"><bookmark_value>values; limiting on input</bookmark_value>
<bookmark_value>limiting values; specifying on input</bookmark_value>
<bookmark_value>permitted cell contents</bookmark_value>
<bookmark_value>data validity</bookmark_value>
<bookmark_value>validity</bookmark_value>
<bookmark_value>cells; validity</bookmark_value>
<bookmark_value>error messages; defining for incorrect input</bookmark_value>
<bookmark_value>actions in case of incorrect input</bookmark_value>
<bookmark_value>Help tips; defining text for cell input</bookmark_value>
<bookmark_value>notes;help text for cells</bookmark_value>
<bookmark_value>cells; defining input help</bookmark_value>
<bookmark_value>macros; running when incorrect input</bookmark_value>
<bookmark_value>data; validity check</bookmark_value>
</bookmark>
<paragraph role="heading" id="hd_id3156442" xml-lang="en-US" level="1" l10n="U" oldref="22"><variable id="validity"><link href="text/scalc/guide/validity.xhp" name="Validity of Cell Contents">Validity of Cell Contents</link>
</variable></paragraph>
<paragraph role="paragraph" id="par_id3156283" xml-lang="en-US" l10n="U" oldref="2">For each cell, you can define in advance what type of contents is valid for that cell. This allows you to guide users through data entry in $[officename] Calc by restricting cells to receive specific values and ranges.</paragraph>
<paragraph role="paragraph" id="par_id3145252" xml-lang="en-US" l10n="U" oldref="3">The validity rule is activated when a new value is entered. If an invalid value has already been inserted into the cell, or if you insert a value in the cell either with drag-and-drop or by copying and pasting, the validity rule will not take effect. You can choose <emph>Tools - Detective</emph> at any time and choose the command <link href="text/scalc/01/06030800.xhp" name="Mark Invalid Data"><emph>Mark Invalid Data</emph></link> to display which cells contain invalid values.</paragraph>
<paragraph role="paragraph" id="par_id3154016" xml-lang="en-US" l10n="U" oldref="4">Additional details about <link href="text/scalc/01/12120000.xhp" name="data validity">data validity</link> can be found in the $[officename] Help.</paragraph>
<paragraph role="tip" id="par_idN10776" xml-lang="en-US" l10n="NEW">You can also insert a list box from the Controls toolbar and link the list box to a cell. This way you can specify the valid values on the <link href="text/shared/02/01170102.xhp">Data</link> page of the list box properties window.</paragraph>
<paragraph role="heading" id="hd_id3155603" xml-lang="en-US" level="2" l10n="U" oldref="5">Using Cell Contents Validity</paragraph>
<list type="ordered">
<listitem>
<paragraph role="paragraph" id="par_id3155959" xml-lang="en-US" l10n="U" oldref="6">Select the cells for which you want to define a new validity rule. You can select multiple cells by clicking on all the cells while holding down the <item type="keycode">Ctrl</item> key.</paragraph>
<paragraph role="note" id="par_id3149530" xml-lang="en-US" l10n="U" oldref="7">The validity rule is a component of the cell format. To copy the validity rule to other cells, choose <item type="menuitem">Edit - Copy</item> and <item type="menuitem">Edit - Paste Special</item>, and select "Formats."</paragraph>
</listitem>
<listitem>
<paragraph role="paragraph" id="par_id3148837" xml-lang="en-US" l10n="U" oldref="8">Choose <item type="menuitem">Data - Validity</item>. The <emph>Validity</emph> dialog appears.</paragraph>
</listitem>
<listitem>
<paragraph role="paragraph" id="par_id3156020" xml-lang="en-US" l10n="U" oldref="9">On the <emph>Criteria</emph> tab page, enter the conditions for new values entered into cells. Values you have already entered will not be affected.</paragraph>
</listitem>
<listitem>
<paragraph role="paragraph" id="par_id3159208" xml-lang="en-US" l10n="U" oldref="10">In the <emph>Allow</emph> field, "All Values" is selected by default. To place a condition on a cell entry, choose from one of the other options listed.</paragraph>
</listitem>
<listitem>
<paragraph role="paragraph" id="par_id3153011" xml-lang="en-US" l10n="U" oldref="11">This choice already sets the first condition. If you choose "Whole Numbers", values such as "12.5" are not allowed, even if they satisfy the other conditions. Choosing "Date" allows date information both in the local date format as well as in the form of a <link href="text/sbasic/shared/03030101.xhp" name="serial date">serial date</link>. Similarly, the "Time" condition permits time values such as "12:00" or serial time numbers. "Text Length" stipulates that cells are allowed to contain text only.</paragraph>
</listitem>
<listitem>
<paragraph role="paragraph" id="par_id3149317" xml-lang="en-US" l10n="U" oldref="13">After you have set the first condition under <emph>Allow</emph>, select the next condition under <emph>Data</emph>. According to what you choose, additional text fields (<emph>Value</emph>, <emph>Minimum </emph>and <emph>Maximum</emph>) may appear to further refine the condition.</paragraph>
</listitem>
<listitem>
<paragraph role="paragraph" id="par_id3153334" xml-lang="en-US" l10n="U" oldref="14">A few possible conditions resulting from this register could be as follows: "Integer greater than 1", "Decimal between 10 and 12.5", "Date earlier than or equal to 1/1/2000", "Time not equal to 00:00", "Text with a length of more than 2 characters".</paragraph>
</listitem>
</list>
<paragraph role="paragraph" id="par_id3151389" xml-lang="en-US" l10n="U" oldref="15">After you have determined the conditions for cell validity, you can use the other two tabs in the dialog to create input help and error/invalid entry messages:</paragraph>
<list type="unordered">
<listitem>
<paragraph role="listitem" id="par_id3159261" xml-lang="en-US" l10n="U" oldref="16">On the <emph>Input Help</emph> tab page, enter the title and the text of the tip, which will then be displayed if the cell is selected.</paragraph>
</listitem>
<listitem>
<paragraph role="listitem" id="par_id3156396" xml-lang="en-US" l10n="U" oldref="17">On the <emph>Error Alert</emph> tab page, select the action to be carried out in the event of an error.</paragraph>
<paragraph role="listitem" id="par_id3147416" xml-lang="en-US" l10n="U" oldref="18">If you select "Stop" as the action, invalid entries are not accepted, and the previous cell contents are retained.</paragraph>
<paragraph role="listitem" id="par_id3150033" xml-lang="en-US" l10n="U" oldref="19">Select "Warning" or "Information" to display a dialog in which the entry can either be canceled (the cell value will be retained) or accepted (even if the new value violates the validity rule).</paragraph>
<paragraph role="listitem" id="par_id3149947" xml-lang="en-US" l10n="U" oldref="20">If you select "Macro", then by using the <emph>Browse</emph> button you can specify a macro to be run in the event of an error.</paragraph>
</listitem>
</list>
<paragraph role="paragraph" id="par_id3149011" xml-lang="en-US" l10n="U" oldref="35">To display the error message, mark the <emph>Show error message when invalid values are entered</emph>. If the option is unmarked, no error message will be displayed, even with an invalid entry.</paragraph>
<embed href="text/scalc/01/12120300.xhp#examplemakro"/>
<paragraph role="note" id="par_id3148586" xml-lang="en-US" l10n="U" oldref="21">After changing the action for a cell on the <emph>Error Alert</emph> tab page and closing the dialog with OK, you must first select another cell before the change takes effect.</paragraph>
<section id="relatedtopics">
<paragraph role="paragraph" id="par_id3154805" xml-lang="en-US" l10n="U" oldref="30"><link href="text/scalc/01/12120000.xhp" name="Data - Validity">Data - Validity</link></paragraph>
</section>
</body>
</helpdocument>