Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Collapse]Spreadsheet
   [Expand]Product Information
    Product Structure
    Getting Started
   [Collapse]Spreadsheet Document
     Workbook
     Worksheets
     Cells and Cell Ranges
     Rows and Columns
     Shapes, Pictures, Charts
     Comments
     Measure Units
    Supported Formats
   [Expand]Cell Basics
   [Expand]Spreadsheet Formulas
    Defined Names
    Data Binding
    Data Validation
   [Expand]Data Presentation
    Data Grouping
   [Expand]Pivot Table Overview
   [Expand]Charting Overview
    Printing
    Events
   [Expand]Mail Merge Overview
    Protection
    Find and Replace
   [Expand]Visual Elements
    Services
   [Expand]Shortcuts
   [Expand]Examples
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Cells and Cell Ranges

All worksheet data is stored in cells. Each cell can only hold and display a single piece of data - the cell value. A cell can also contain a formula that calculates the cell value dynamically.

An individual cell is a box at the intersection of a column and row. Thus, a cell reference is usually a combination of a column letter and a row number. For example, C3 refers to a cell that belongs to column C and row 3. Other cell reference styles and types are also supported.

You can format cells to improve worksheet appearance, and make it easy for end-users to read and understand its content.

When working with worksheet data, you can access and modify individual cells (Cell) as well as cell ranges (Range). The Range interface provides the basic functionality required to work with worksheet cells.

Property/Method

Description

Example

CellCollection.Item, Worksheet.Item

Row.Item, Column.Item, Range.Item

Access an individual cell from a worksheet's collection of all cells, from a particular row or column, or from any range of cells.

How to: Access a Cell in a Worksheet

Worksheet.Range

Worksheet.GetUsedRange

When working with a worksheet (for example, formatting cells or processing data), you can manipulate not only individual cells but also cell ranges. You can access a range of cells (Range) which can be contiguous or discontinuous, or a cell range that includes the entire content of a worksheet (the worksheet's used range).

How to: Access a Range of Cells

Worksheet.SelectedCell, Worksheet.Selection

Specifies an active cell and range of cells selected in the worksheet.

How to: Obtain Selected Range and Active Cell

Range.GetReferenceA1, Range.GetReferenceR1C1

Return a cell or cell range reference in the corresponding cell reference style.

How to: Use Cell and Worksheet References in Formulas

Range.Union, IRangeProvider.Union

Create a complex (union) range by adding a range to another range, or from a list, or from an array of ranges.

Range.Areas

Access a collection of ranges which comprise the current range if the current range is the range union.

Cell.ColumnIndex, Cell.RowIndex

Range.TopRowIndex, Range.BottomRowIndex, Range.LeftColumnIndex, Range.RightColumnIndex, Range.RowCount, Range.ColumnCount

For an individual cell, you can obtain indexes of the row and column to which this cell belongs.

For a range of cells, you can get indexes of its bound rows and columns, and obtain the number of rows and columns in the range.

Range.Value

Sets data of a specified type to a cell or a cell range. You can also use this property to retrieve information about the type of a cell's actual value, and get the cell value itself as an object of the corresponding type. If a cell contains a formula, this property returns a value resulting from the formula.

For more information, see the Cell Data Types document.

How to: Change a Cell or Cell Range Value

Cell.DisplayText

Gets a cell value as it is displayed.

Range.Formula

Range.ArrayFormula, Range.HasArrayFormula, Cell.IsTopLeftCellInArrayFormulaRange

Use formulas in cells to dynamically perform calculations on worksheet data. Values displayed in cells with formulas are automatically recalculated and updated after processed data has been changed.

How to: Add Formulas to Cells

How to: Create Shared Formulas

How to: Create Array Formulas

Worksheet.InsertCells

Inserts empty cells in a worksheet, above or to the left of the specified cell or cell range, shifting other cells in the same row to the right and cells in the same column down.

How to: Insert a Cell or Cell Range

Range.CopyFrom

Copy information (all information, values only, formats only, borders only, etc.) from cells to other cells.

How to: Copy Cell Data Only, Cell Style Only, or Cell Data with Style

Worksheet.ClearContents

Worksheet.ClearFormats

Worksheet.ClearComments

Worksheet.ClearHyperlinks

Worksheet.Clear

Remove content, formats, hyperlinks or all information from cells.

How to: Clear Cells of Content, Formatting, Hyperlinks and Comments

Range.BeginUpdateFormatting - Range.EndUpdateFormatting

Range.Style

Range.FillColor

Formatting.Fill

Formatting.Font

Formatting.NumberFormat

Formatting.Alignment

Formatting.Borders, Range.SetInsideBorders

Format an individual cell or a cell range using styles, or by directly changing and setting the required formatting characteristics for a cell or a range of cells.

For details, see Formatting Cells.

Formatting Cells

Range.IsIntersecting

Range.Intersect

Allow you to determine whether or not cell ranges intersect, and obtain the intersection of ranges.

Range.Name

Worksheet.DefinedNames, DefinedNameCollection.Add

You can name individual cells and cell ranges (as well as formulas and constants), making it easier to understand the purpose of named cells, and as a result, making it easier to use them.

For more information, refer to the Defined Names topic.

How to: Create a Named Range of Cells

Worksheet.DeleteCells

Deletes cells from a worksheet, shifting other cells in the same row to the left, and cells in the same column up.

How to: Delete a Cell or Range of Cells

Worksheet.Hyperlinks

HyperlinkCollection.Add

HyperlinkCollection.GetHyperlinks

Insert hyperlinks into cells.

How to: Add a Hyperlink to a Cell

Worksheet.MergeCells, Worksheet.UnMergeCells

Merge several adjacent cells into one cell, and split merged cells.

How to: Merge Cells or Split Merged Cells

Expanded See Also

How would you rate this topic?​​​​​​​