Manage individual cells in a spreadsheet.
The Cell class is required to know its value and type, display options, and any other features of an Excel cell. Utilities for referencing cells using Excel’s ‘A1’ column/row nomenclature are also provided.
openpyxl.cell.cell.
Cell
(
worksheet
,
row=None
,
column=None
,
value=None
,
style_array=None
)
[source]
¶
Bases:
openpyxl.styles.styleable.StyleableObject
Describes cell associated properties.
Properties of interest include style, type, value, and address.
base_date
¶
col_idx
¶
The numerical index of the column
column
¶
Column number of this cell (1-based)
column_letter
¶
comment
¶
Returns the comment associated with this cell
| 类型: |
openpyxl.comments.Comment
|
|---|
coordinate
¶
This cell’s coordinate (ex. ‘A5’)
data_type
¶
encoding
¶
hyperlink
¶
Return the hyperlink target or an empty string
internal_value
¶
Always returns the value for excel.
is_date
¶
True if the value is formatted as a date
| 类型: | bool |
|---|
offset
(
row=0
,
column=0
)
[source]
¶
Returns a cell location relative to this cell.
| 参数: |
|
|---|---|
| 返回类型: |
openpyxl.cell.Cell
|
parent
¶
row
¶
Row number of this cell (1-based)
值
¶
Get or set the value held in the cell.
| 类型: |
depends on the value (string, float, int or
datetime.datetime
)
|
|---|
openpyxl.cell.cell.
MergedCell
(
worksheet
,
row=None
,
column=None
)
[source]
¶
Bases:
openpyxl.styles.styleable.StyleableObject
Describes the properties of a cell in a merged cell and helps to display the borders of the merged cell.
The value of a MergedCell is always None.
column
¶
comment
= None
¶
coordinate
¶
This cell’s coordinate (ex. ‘A5’)
data_type
= 'n'
¶
hyperlink
= None
¶
row
¶
值
= None
¶