Show / Hide Table of Contents

Class Worksheet

Represents an Excel worksheet

Inheritance
System.Object
Sheet
Worksheet
Macrosheet
Inherited Members
Sheet.Visibility
Sheet.Name
Sheet.Workbook
Sheet.Properties
Sheet.Protection
Namespace: DRIT.Spreadsheet
Assembly: DRIT.Spreadsheet.dll
Syntax
public class Worksheet : Sheet, IWorksheet

Properties

ActiveCell

Get or set the active cell of the worksheet which receives keyboard message.

Declaration
public Cell ActiveCell { get; set; }
Property Value
Type Description
Cell

ActiveXControls

Declaration
public WorksheetActiveXControlCollection ActiveXControls { get; }
Property Value
Type Description
WorksheetActiveXControlCollection

AutoFilter

Get or set the auto filter of the worksheet

Declaration
public AutoFilter AutoFilter { get; }
Property Value
Type Description
AutoFilter

CalculationProperties

Declaration
public WorksheetCalculationProperties CalculationProperties { get; }
Property Value
Type Description
WorksheetCalculationProperties

CellWatches

Declaration
public List<CellWatch> CellWatches { get; set; }
Property Value
Type Description
List<CellWatch>

Charts

Declaration
public WorksheetChartsCollection Charts { get; }
Property Value
Type Description
WorksheetChartsCollection

ColumnBreaks

Get the column breaks

Declaration
public PageBreakCollection ColumnBreaks { get; }
Property Value
Type Description
PageBreakCollection

Columns

Get the collection of columns of the worksheet

Declaration
public ColumnCollection Columns { get; }
Property Value
Type Description
ColumnCollection

Comments

Declaration
public CommentCollection Comments { get; }
Property Value
Type Description
CommentCollection

ConditionalFormattings

Declaration
public ConditionalFormattingCollection ConditionalFormattings { get; }
Property Value
Type Description
ConditionalFormattingCollection

CustomProperties

Declaration
public List<CustomProperty> CustomProperties { get; }
Property Value
Type Description
List<CustomProperty>

DataConsolidate

Declaration
public DataConsolidate DataConsolidate { get; }
Property Value
Type Description
DataConsolidate

DataValidations

Declaration
public DataValidationCollection DataValidations { get; }
Property Value
Type Description
DataValidationCollection

DateTimeOrigin

Declaration
public DateTimeOrigin DateTimeOrigin { get; }
Property Value
Type Description
DateTimeOrigin

DefaultColumnWidthCharacter

Gets or sets the default column width in characters for the worksheet.

Declaration
public double DefaultColumnWidthCharacter { get; set; }
Property Value
Type Description
System.Double

DefaultColumnWidthPixel

Gets or sets the default column width for a worksheet in pixels.

Declaration
public double DefaultColumnWidthPixel { get; set; }
Property Value
Type Description
System.Double

DefaultRowHeightPixels

Declaration
public double DefaultRowHeightPixels { get; set; }
Property Value
Type Description
System.Double

DefaultRowHeightPoints

Gets or sets the default of height of the rows in points.

Declaration
public double DefaultRowHeightPoints { get; set; }
Property Value
Type Description
System.Double

FormControls

Declaration
public WorksheetFormControlCollection FormControls { get; }
Property Value
Type Description
WorksheetFormControlCollection

Hyperlinks

Get the hyperlinks on a worksheet.

Declaration
public HyperlinkCollection Hyperlinks { get; }
Property Value
Type Description
HyperlinkCollection

Item[CellAddress]

Declaration
public Cell this[CellAddress address] { get; }
Parameters
Type Name Description
CellAddress address
Property Value
Type Description
Cell

Item[Int32, Int32]

Get the cell at a given row and column index

Declaration
public Cell this[int row, int column] { get; }
Parameters
Type Name Description
System.Int32 row

The index of the row, zero based

System.Int32 column

The index of the column, zero based

Property Value
Type Description
Cell

The cell

Item[String]

Get the cell for a given label (e.g. "A1")

Declaration
public Cell this[string label] { get; }
Parameters
Type Name Description
System.String label

The cell label

Property Value
Type Description
Cell

The cell

OleObjects

Declaration
public OleObjectCollection OleObjects { get; }
Property Value
Type Description
OleObjectCollection

PageSetup

Declaration
public WorksheetPageSetup PageSetup { get; }
Property Value
Type Description
WorksheetPageSetup

PivotTables

Declaration
public PivotTableCollection PivotTables { get; }
Property Value
Type Description
PivotTableCollection

QueryTables

Get the query tables of the worksheet

Declaration
public QueryTableCollection QueryTables { get; }
Property Value
Type Description
QueryTableCollection

Range

Declaration
public RangeAccessor Range { get; }
Property Value
Type Description
RangeAccessor

RowBreaks

Get the row breaks

Declaration
public PageBreakCollection RowBreaks { get; }
Property Value
Type Description
PageBreakCollection

Rows

Gets the collection of rows of the worksheet

Declaration
public RowCollection Rows { get; }
Property Value
Type Description
RowCollection

Scenarios

Get or set the scenarios of the worksheet

Declaration
public ScenarioCollection Scenarios { get; }
Property Value
Type Description
ScenarioCollection

Selection

Get or set the selection range of the worksheet. The selection range must contain the active cell.

Declaration
public Range Selection { get; set; }
Property Value
Type Description
Range

Shapes

Declaration
public WorksheetShapeCollection Shapes { get; }
Property Value
Type Description
WorksheetShapeCollection

Slicers

Declaration
public SlicerCollection Slicers { get; }
Property Value
Type Description
SlicerCollection

SortedRanges

Declaration
public List<SortState> SortedRanges { get; }
Property Value
Type Description
List<SortState>

SparkLineGroups

Get the list of spark line groups

Declaration
public SparklineGroupCollection SparkLineGroups { get; }
Property Value
Type Description
SparklineGroupCollection

Tables

Get the tables of the worksheet

Declaration
public TableCollection Tables { get; }
Property Value
Type Description
TableCollection

Timelines

Declaration
public TimelineCollection Timelines { get; }
Property Value
Type Description
TimelineCollection

UsedRange

Get the used range.

Declaration
public Range UsedRange { get; }
Property Value
Type Description
Range

View

Declaration
public WorksheetView View { get; }
Property Value
Type Description
WorksheetView

Methods

Calculate()

Calculate the entire worksheet

Declaration
public void Calculate()

Clear()

Remove all content, cell formatting and tables from the worksheet

Declaration
public void Clear()

Filter(String)

Declaration
public AutoFilter Filter(string rangeReference)
Parameters
Type Name Description
System.String rangeReference
Returns
Type Description
AutoFilter

FindAll(FindArguments)

Declaration
public IEnumerable<Cell> FindAll(FindArguments arguments)
Parameters
Type Name Description
FindArguments arguments
Returns
Type Description
IEnumerable<Cell>

GetRange(Cell, Cell)

Get a rectangular range of cell between two cells

Declaration
public Range GetRange(Cell cell1, Cell cell2)
Parameters
Type Name Description
Cell cell1

The top left cell of the range

Cell cell2

The bottom right cell of the range

Returns
Type Description
Range

The range

GetRange(String)

Declaration
public Range GetRange(string label)
Parameters
Type Name Description
System.String label
Returns
Type Description
Range

Merge(Range)

Declaration
public void Merge(Range range)
Parameters
Type Name Description
Range range

Merge(String)

Declaration
public void Merge(string label)
Parameters
Type Name Description
System.String label

ReplaceAll(ReplaceArguments)

Declaration
public void ReplaceAll(ReplaceArguments arguments)
Parameters
Type Name Description
ReplaceArguments arguments

Unmerge(String)

Declaration
public void Unmerge(string label)
Parameters
Type Name Description
System.String label

Events

LayoutChanged

Occurs when the layout of the worksheet change, e.g. when a column is resized

Declaration
public event EventHandler LayoutChanged
Event Type
Type Description
EventHandler
Back to top Generated by DocFX