The cell type affects how the contents of the cell are displayed. The cell contains formatted and unformatted data.
The Text property contains the formatted data which is displayed in the cell; the Value property contains the unformatted data which is saved in the model. You can use the SheetView GetText and GetValue methods to obtain the contents of the cell, regardless of cell type. For more information about data methods and properties, refer to Placing and Retrieving Data.
The following table lists the editable cell types, and how each cell type works with the data, whether formatted (Text property) or unformatted (Value property).�
Editable Cell Type |
Sample Input |
Resultant (Text) Formatted Data |
Resultant (Value) Unformatted Data |
---|---|---|---|
"$10,000.00" |
"$10,000.00" |
10000.00 |
|
"10/29/2002" |
"10/29/2002" |
DateTime object of Tuesday, October 29, 2002 12:00:00 AM |
|
"10000.00" |
"10000.00" |
10000.00 |
|
Any text |
String of that data |
Depends on whether DateTime, Boolean, or Text returns the DateTime object, the Boolean value or the Text value |
|
"12345" |
"12345" |
12345 |
|
"15%" |
"15%" |
0.15 |
|
RegExpCellType (Regular Expression) |
"123-45-6789" |
"123-45-6789" |
"123-45-6789" |
Any text |
String of that text |
String of that text |
The DateTime cell returns data in the format of the FormatString property setting. In this example, the format string is set to "F".
If the cell's Multiline property is set to true, you can include a line feed character to include a line break when setting text.
Numbers are converted to scientific notation if they are greater than 999,999,999,999,999 or less than -999,999,999,999,999. Low fraction numbers are also converted to scientific notation.
The following table lists the graphical cell types, and how each cell type works with the data, whether formatted (Text property) or unformatted (Value property).�
Graphical Cell Type |
Sample Input |
Resultant (Text) Formatted Data |
Resultant (Value) Unformatted Data |
---|---|---|---|
null |
null |
null |
|
True (checked) |
"True" |
1 |
|
False (unchecked) |
"False" |
0 |
|
Not set; looks false |
Empty string |
Null |
|
Any item |
Text of selected item |
Text of selected item or index of selected item |
|
No item selected |
Empty string |
Null |
|
Any text |
String of that text |
"True" (for visited link) or "False" (for not visited) |
|
Any text |
String of that text |
String of that text |
|
Any item selected |
Text of the selected item |
Text of or index of selected item |
|
MultiColumnComboBoxCellType | Any item | Text of selected item | Text of selected item or index of selected item |
Any item selected |
Text of the selected item |
Text of or index of selected item |
|
No item selected |
Empty string |
Null |
Return to the overview at Understanding How Cell Types Work.