The Text contains the formatted data as displayed in the cell; the Value contains the unformatted data as saved in the model. You can use the SheetView GetText and GetValue methods to obtain the contents of the cell, regardless of cell type.
The following table lists the editable cell types, and how each cell type works with the data, whether formatted (Text) or unformatted (Value).
Editable Cell Type | Sample Input | Resultant Formatted Data | Resultant 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 |
|
Any data |
String of that data |
Depends on whether DateTime, Boolean, or Text returns the DateTime object, the Boolean value or the Text value |
|
"123-45-6789" |
"123-45-6789" |
"123456789" |
|
"10000.00" |
"10000.00" |
10000.00 |
|
"15%" |
"15%" |
0.15 |
|
"99-999-9999" |
"99-999-9999" |
"99-999-9999" |
|
Any text |
String of that text |
String of that text |
The following table lists the graphical cell types, and how each cell type works with the Text property.
Graphical Cell Type | Sample Input | Resultant Text Data | Resultant Value Data |
---|---|---|---|
Picture as data |
N/A |
N/A |
|
ButtonCellType two-state |
True |
"1" |
True |
False |
"0" |
False |
|
Not set looks false |
Empty string |
False |
|
CheckBoxCellType two-state |
True (checked) |
"True" |
1 |
False (unchecked) |
"False" |
0 |
|
Not set looks false |
Empty string |
False |
|
CheckBoxCellType three-state |
True (checked) |
"1" |
1 |
False (unchecked) |
"0" |
0 |
|
Indeterminate (gray) |
"2" |
2 |
|
Not set looks false |
Empty string |
0 |
|
Selected color |
Color name |
Color name |
|
Any item |
Text of selected item |
Text of selected item or index of selected item (see EditorValue property) |
|
Nothing selected |
Empty string |
Null |
|
any text |
Array of Boolean values: "True" (for visited link) or "False" (for not visited) |
Array of Boolean values: "True" (for visited link) or "False" (for not visited) |
|
Picture as data |
N/A |
N/A |
|
Array |
Array |
Array |
|
Any item selected |
Text of selected item |
Index of selected item (numeric) |
|
Nothing selected |
Empty string |
Null |
|
15, between 10 and 20 |
"50%" (string representation of numeric value) |
15 (actual value) |
|
String in rich text format |
String in rich text format |
String in rich text format |
|
4, between 0 and 10 |
"4" (string representation of numeric value) |
4 |
For information on other aspects of cell display, refer to Resizing a Cell to Fit the Data.
Return to the overview at Understanding How Cell Types Work.