Click or drag to resize
PicoXLSX

Worksheet Methods

The Worksheet type exposes the following members.

Methods
 NameDescription
Public methodAddAllowedActionOnSheetProtection Method to add allowed actions if the worksheet is protected. If one or more values are added, UseSheetProtection will be set to true
Public methodAddCell(Object, String) Adds an object to the defined cell address. If the type of the value does not match with one of the supported data types, it will be casted to a String. A prepared object of the type Cell will not be casted but adjusted
Public methodAddCell(Object, Int32, Int32) Adds an object to the defined cell address. If the type of the value does not match with one of the supported data types, it will be casted to a String. A prepared object of the type Cell will not be casted but adjusted
Public methodAddCell(Object, String, Style) Adds an object to the defined cell address. If the type of the value does not match with one of the supported data types, it will be casted to a String. A prepared object of the type Cell will not be casted but adjusted
Public methodAddCell(Object, Int32, Int32, Style) Adds an object to the defined cell address. If the type of the value does not match with one of the supported data types, it will be casted to a String. A prepared object of the type Cell will not be casted but adjusted
Public methodAddCellFormula(String, String) Adds a cell formula as string to the defined cell address
Public methodAddCellFormula(String, Int32, Int32) Adds a cell formula as string to the defined cell address
Public methodAddCellFormula(String, String, Style) Adds a cell formula as string to the defined cell address
Public methodAddCellFormula(String, Int32, Int32, Style) Adds a cell formula as string to the defined cell address
Public methodAddCellRange(IReadOnlyListObject, String) Adds a list of object values to a defined cell range. If the type of the a particular value does not match with one of the supported data types, it will be casted to a String. Prepared objects of the type Cell will not be casted but adjusted
Public methodAddCellRange(IReadOnlyListObject, CellAddress, CellAddress) Adds a list of object values to a defined cell range. If the type of the a particular value does not match with one of the supported data types, it will be casted to a String. Prepared objects of the type Cell will not be casted but adjusted
Public methodAddCellRange(IReadOnlyListObject, String, Style) Adds a list of object values to a defined cell range. If the type of the a particular value does not match with one of the supported data types, it will be casted to a String. Prepared objects of the type Cell will not be casted but adjusted
Public methodAddCellRange(IReadOnlyListObject, CellAddress, CellAddress, Style) Adds a list of object values to a defined cell range. If the type of the a particular value does not match with one of the supported data types, it will be casted to a String. Prepared objects of the type Cell will not be casted but adjusted
Private methodAddCellRangeInternalT Internal function to add a generic list of value to the defined cell range
Public methodAddHiddenColumn(Int32) Sets the defined column as hidden
Public methodAddHiddenColumn(String) Sets the defined column as hidden
Public methodAddHiddenRow Sets the defined row as hidden
Public methodAddNextCell(Object) Adds an object to the next cell position. If the type of the value does not match with one of the supported data types, it will be casted to a String. A prepared object of the type Cell will not be casted but adjusted
Public methodAddNextCell(Object, Style) Adds an object to the next cell position. If the type of the value does not match with one of the supported data types, it will be casted to a String. A prepared object of the type Cell will not be casted but adjusted
Private methodAddNextCell(Cell, Boolean, Style) Method to insert a generic cell to the next cell position
Public methodAddNextCellFormula(String) Adds a formula as string to the next cell position
Public methodAddNextCellFormula(String, Style) Adds a formula as string to the next cell position
Public methodAddSelectedCells(CellRange) Adds a range to the selected cells on this worksheet
Public methodAddSelectedCells(String) Adds a range to the selected cells on this worksheet. Null or empty as value will be ignored
Public methodAddSelectedCells(CellAddress, CellAddress) Adds a range to the selected cells on this worksheet
Private methodCastValue Method to cast a value or align an object of the type Cell to the context of the worksheet
Public methodCellsByValue Searches for cells that contain the specified value and returns a list of these cells.
Public methodClearActiveStyle Clears the active style of the worksheet. All later added calls will contain no style unless another active style is set
Public methodCopy Creates a (dereferenced) deep copy of this worksheet
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodFirstCellByValue Searches for the first occurrence of the value.
Public methodFirstOrDefaultCell Searches for the first occurrence of the expression. Example: var cell = worksheet.FindCell(c => c.Value?.ToString().Contains("searchValue"));
Private methodGetBoundaryDataNumber Gets either the minimum or maximum row or column number, considering only calls with data
Private methodGetBoundaryNumber Gets either the minimum or maximum row or column number, considering all available data
Public methodGetCell(CellAddress) Gets the cell of the specified address
Public methodGetCell(Int32, Int32) Gets the cell of the specified column and row number (zero-based)
Public methodGetColumn(Int32) Gets a column as list of cell objects
Public methodGetColumn(String) Gets a column as list of cell objects
Public methodGetCurrentColumnNumber Gets the current column number (zero based)
Public methodGetCurrentRowNumber Gets the current row number (zero based)
Public methodGetFirstCellAddress Gets the first existing cell in the current worksheet (bottom right)
Public methodGetFirstColumnNumber Gets the first existing column number in the current worksheet (zero-based)
Public methodGetFirstDataCellAddress Gets the first existing cell with data in the current worksheet (bottom right)
Public methodGetFirstDataColumnNumber Gets the first existing column number with data in the current worksheet (zero-based)
Public methodGetFirstDataRowNumber Gets the first existing row number with data in the current worksheet (zero-based)
Public methodGetFirstRowNumber Gets the first existing row number in the current worksheet (zero-based)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetLastCellAddress Gets the last existing cell in the current worksheet (bottom right)
Public methodGetLastColumnNumber Gets the last existing column number in the current worksheet (zero-based)
Public methodGetLastDataCellAddress Gets the last existing cell with data in the current worksheet (bottom right)
Public methodGetLastDataColumnNumber Gets the last existing column number with data in the current worksheet (zero-based)
Public methodGetLastDataRowNumber Gets the last existing row number with data in the current worksheet (zero-based)
Public methodGetLastRowNumber Gets the last existing row number in the current worksheet (zero-based)
Private methodGetMaxRow Gets the maximum row coordinate either from cell data, height definitions or hidden rows
Private methodGetMinRow Gets the minimum row coordinate either from cell data, height definitions or hidden rows
Public methodGetRow Gets a row as list of cell objects
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Private methodStatic memberGetUnusedWorksheetName Determines the next unused worksheet name in the passed workbook
Public methodGoToNextColumn Moves the current position to the next column
Public methodGoToNextColumn(Int32, Boolean) Moves the current position to the next column with the number of cells to move
Public methodGoToNextRow Moves the current position to the next row (use for a new line)
Public methodGoToNextRow(Int32, Boolean) Moves the current position to the next row with the number of cells to move (use for a new line)
Public methodHasCell(CellAddress) Gets whether the specified address exists in the worksheet. Existing means that a value was stored at the address
Public methodHasCell(Int32, Int32) Gets whether the specified address exists in the worksheet. Existing means that a value was stored at the address
Public methodInsertColumn Inserts 'count' columns right of the specified 'columnNumber'. Existing cells are moved to the right by the number of new columns. The inserted, new columns inherits the style of the original cell at the defined column number. The inserted cells are empty. The values can be set later
Public methodInsertRow Inserts 'count' rows below the specified 'rowNumber'. Existing cells are moved down by the number of new rows. The inserted, new rows inherits the style of the original cell at the defined row number. The inserted cells are empty. The values can be set later
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodMergeCells(CellRange) Merges the defined cell range
Public methodMergeCells(String) Merges the defined cell range
Public methodMergeCells(CellAddress, CellAddress) Merges the defined cell range
Protected methodRecalculateAutoFilter Method to recalculate the auto filter (columns) of this worksheet. This is an internal method. There is no need to use it
Protected methodRecalculateColumns Method to recalculate the collection of columns of this worksheet. This is an internal method. There is no need to use it
Public methodRemoveAllowedActionOnSheetProtection Removes an allowed action on the current worksheet or its cells
Public methodRemoveAutoFilter Removes auto filters from the worksheet
Public methodRemoveCell(String) Removes a previous inserted cell at the defined address
Public methodRemoveCell(Int32, Int32) Removes a previous inserted cell at the defined address
Public methodRemoveHiddenColumn(Int32) Sets a previously defined, hidden column as visible again
Public methodRemoveHiddenColumn(String) Sets a previously defined, hidden column as visible again
Public methodRemoveHiddenRow Sets a previously defined, hidden row as visible again
Public methodRemoveMergedCells Removes the defined merged cell range
Public methodRemoveRowHeight Removes the defined, non-standard row height
Public methodRemoveSelectedCells Removes the cell selection of this worksheet
Public methodReplaceCellValue Replaces all occurrences of 'oldValue' with 'newValue' and returns the number of replacements.
Public methodResetColumn Resets the defined column, if existing. The corresponding instance will be removed from Columns
Public methodResetSplit Resets splitting of the worksheet into panes, as well as their freezing
Protected methodResolveMergedCells Method to resolve all merged cells of the worksheet. Only the value of the very first cell of the locked cells range will be visible. The other values are still present (set to EMPTY) but will not be stored in the worksheet.
This is an internal method. There is no need to use it
Public methodStatic memberSanitizeWorksheetName Sanitizes a worksheet name
Public methodSetActiveStyle Sets the active style of the worksheet. This style will be assigned to all later added cells
Public methodSetAutoFilter(String) Sets the column auto filter within the defined column range
Public methodSetAutoFilter(Int32, Int32) Sets the column auto filter within the defined column range
Public methodSetColumnDefaultStyle(Int32, Style) Sets the default column style of the passed column number (zero-based)
Public methodSetColumnDefaultStyle(String, Style) Sets the default column style of the passed column address
Private methodSetColumnHiddenState Sets the defined column as hidden or visible
Public methodSetColumnWidth(Int32, Single) Sets the width of the passed column number (zero-based)
Public methodSetColumnWidth(String, Single) Sets the width of the passed column address
Public methodSetCurrentCellAddress(String) Set the current cell address
Public methodSetCurrentCellAddress(Int32, Int32) Set the current cell address
Public methodSetCurrentColumnNumber Sets the current column number (zero based)
Public methodSetCurrentRowNumber Sets the current row number (zero based)
Public methodSetHorizontalSplit(Single, CellAddress, WorksheetWorksheetPane) Sets the horizontal split of the worksheet into two panes. The measurement in characters cannot be used to freeze panes
Public methodSetHorizontalSplit(Int32, Boolean, CellAddress, WorksheetWorksheetPane) Sets the horizontal split of the worksheet into two panes. The measurement in rows can be used to split and freeze panes
Public methodSetRowHeight Sets the height of the passed row number (zero-based)
Private methodSetRowHiddenState Sets the defined row as hidden or visible
Public methodSetSelectedCells(CellRange)Obsolete.
Sets a single range of selected cells on this worksheet. All existing ranges will be removed
Public methodSetSelectedCells(String)Obsolete.
Sets a single range of selected cells on this worksheet. All existing ranges will be removed. Null will remove all selected cells
Public methodSetSelectedCells(CellAddress, CellAddress)Obsolete.
Sets the selected cells on this worksheet
Public methodSetSheetName(String) Validates and sets the worksheet name
Public methodSetSheetName(String, Boolean) Sets the name of the worksheet
Public methodSetSheetProtectionPassword Sets or removes the password for worksheet protection. If set, UseSheetProtection will be also set to true
Public methodSetSplit(NullableSingle, NullableSingle, CellAddress, WorksheetWorksheetPane) Sets the horizontal and vertical split of the worksheet into four panes. The measurement in characters cannot be used to freeze panes
Public methodSetSplit(NullableInt32, NullableInt32, Boolean, CellAddress, WorksheetWorksheetPane) Sets the horizontal and vertical split of the worksheet into four panes. The measurement in rows and columns can be used to split and freeze panes
Public methodSetStyle(CellAddress, Style) Sets the passed style on the passed (singular) cell address. If the cell is already existing, the style will be added or replaced Sets the passed style on the passed (singular) cell address. If the cell is already existing, the style will be added or replaced
Public methodSetStyle(CellRange, Style) Sets the passed style on the passed cell range. If cells are already existing, the style will be added or replaced
Public methodSetStyle(String, Style) Sets the passed style on the passed address expression. Such an expression may be a single cell or a cell range Sets the passed style on the passed address expression. Such an expression may be a single cell or a cell range Sets the passed style on the passed address expression. Such an expression may be a single cell or a cell range
Public methodSetStyle(CellAddress, CellAddress, Style) Sets the passed style on the passed cell range, derived from a start and end address. If cells are already existing, the style will be added or replaced Sets the passed style on the passed cell range, derived from a start and end address. If cells are already existing, the style will be added or replaced
Public methodSetVerticalSplit(Single, CellAddress, WorksheetWorksheetPane) Sets the vertical split of the worksheet into two panes. The measurement in characters cannot be used to freeze panes
Public methodSetVerticalSplit(Int32, Boolean, CellAddress, WorksheetWorksheetPane) Sets the vertical split of the worksheet into two panes. The measurement in columns can be used to split and freeze panes
Public methodSetZoomFactor Sets a zoom factor for a given WorksheetSheetViewType. If AUTO_ZOOM_FACTOR, the zoom factor is set to automatic
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Private methodStatic memberWorksheetExists Checks whether a worksheet with the given name exists
Top
See Also