Cells

Overview

Cells is a class in Aspose.Cells FOSS for Python.

Represents a collection of cells in a worksheet.

This class provides 58 methods for working with Cells objects in Python programs. Available methods include: ClearHorizontalPageBreaks, ClearVerticalPageBreaks, GetColumnWidth, GetRowHeight, IsColumnHidden, IsRowHidden, Merge, RemoveHorizontalPageBreak, RemoveVerticalPageBreak, SetColumnHidden, SetColumnWidth, SetHorizontalPageBreak, and 46 additional methods. All exported members are accessible to any Python application after installing the Aspose.Cells FOSS for Python package.

Methods

SignatureDescription
__init__(worksheet)Initializes a new instance of the Cells class.
cell(row, column)Accesses a cell by row and column (1-based).
column_index_from_string(column)Converts a column letter to a 1-based index.
column_letter_from_index(column_index)Converts a 1-based column index to a letter.
coordinate_from_string(coord)Converts an A1 coordinate string to (row, column) tuple (1-based).
coordinate_to_string(row, column)Converts row and column (1-based) to an A1 coordinate string.
iter_rows(min_row, max_row, min_col, max_col, values_only)Iterates over rows in the worksheet.
iter_cols(min_row, max_row, min_col, max_col, values_only)Iterates over columns in the worksheet.
count()Gets the number of cells in the collection.
clear()Clears all cells in the collection.
get_cell_by_name(cell_name)Gets a cell by its name (reference).
set_cell_by_name(cell_name, value)Sets a cell value by its name (reference).
get_cell(row, column)Gets a cell by row and column (1-based).
set_cell(row, column, value)Sets a cell value by row and column (1-based).
set_row_height(row, height)Sets the height of the specified row in points.
get_row_height(row)Gets the height of the specified row in points.
hide_row(row)Hides the specified row.
unhide_row(row)Unhides the specified row.
is_row_hidden(row)Checks if the specified row is hidden.
set_column_width(column, width)Sets the width of the specified column in character units.
get_column_width(column)Gets the width of the specified column in character units.
hide_column(column)Hides the specified column.
unhide_column(column)Unhides the specified column.
is_column_hidden(column)Checks if the specified column is hidden.
SetRowHeight(row, height)Sets the height of the given row in points (capitalized alias)
GetRowHeight(row)
SetColumnWidth(column, width)Sets the width of the given column in character units (capitalized alias)
GetColumnWidth(column)
SetRowHidden(row, is_hidden)Sets the hidden state of the specified row
IsRowHidden(row)Returns whether the specified row is hidden (capitalized alias)
SetColumnHidden(column, is_hidden)Sets the hidden state of the specified column
IsColumnHidden(column)
merge(first_row, first_column, total_rows, total_columns)Merges a rectangular range of cells.
unmerge(first_row, first_column, total_rows, total_columns)Unmerges a previously merged rectangular range of cells.
merge_range(range_ref)Merges a range specified in A1 notation.
unmerge_range(range_ref)Unmerges a range specified in A1 notation.
get_merged_cells()Gets all merged cell ranges in A1 notation.
Merge(first_row, first_column, total_rows, total_columns)
UnMerge(first_row, first_column, total_rows, total_columns)
set_horizontal_page_break(row)Adds a manual horizontal page break at the specified 0-based row index.
remove_horizontal_page_break(row)Removes a manual horizontal page break at the specified 0-based row index.
clear_horizontal_page_breaks()Clears all manual horizontal page breaks.
get_horizontal_page_breaks()Gets all manual horizontal page breaks.
set_vertical_page_break(column)Adds a manual vertical page break at the specified 0-based column index.
remove_vertical_page_break(column)Removes a manual vertical page break at the specified 0-based column index.
clear_vertical_page_breaks()Clears all manual vertical page breaks.
get_vertical_page_breaks()Gets all manual vertical page breaks.
SetHorizontalPageBreak(row)
RemoveHorizontalPageBreak(row)
ClearHorizontalPageBreaks()
SetVerticalPageBreak(column)
RemoveVerticalPageBreak(column)
ClearVerticalPageBreaks()
get_range(start_row, start_column, end_row, end_column)Gets a range of cells as a list of lists.
set_range(start_row, start_column, end_row, end_column, values)Sets values for a range of cells.
has_cell(cell_name)Checks if a cell exists in the collection.
delete_cell(cell_name)Deletes a cell from the collection.
get_all_cells()Gets all cells in the collection.

See Also