# Accessing Cells of a Worksheet

Each worksheet consists of cells organized in rows and columns. To manipulate the data and properties of the cells, create and use an instance of the `CellSelection` class that holds the desired cell region and then invoke the appropriate action for this `CellSelection` instance. This class exposes a rich API that allows you to get, set, and clear cell values, colors, borders, and style.

The document model offers multiple ways to create a `CellSelection` object. The following examples list all approaches you can use to retrieve a `CellSelection` instance. Each example creates a new workbook, adds one worksheet, and creates a selection for its cells.

Use a `CellIndex` object to specify a single cell (identified by a row index and column index) from the sheet and create a `CellSelection` for this single cell. Then, you can get the [Value](https://www.telerik.com/document-processing-libraries/documentation/libraries/radspreadprocessing/working-with-cells/cell-value-types) of the cell.

**Example 1: Create CellSelection Using CellIndex**

```C#
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets.Add();

CellIndex cellIndex = new CellIndex(0, 5);
CellSelection selection1 = worksheet.Cells[cellIndex];
```

**Example 2: Create CellSelection Using CellRange**

```C#
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets.Add();

CellRange cellRange = new CellRange(0, 0, 5, 5);
CellSelection selection2 = worksheet.Cells[cellRange];
```

**Example 3: Create CellSelection Using Multiple CellRange Objects**

```C#
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets.Add();

List<CellRange> ranges = new List<CellRange>();
ranges.Add(new CellRange(0, 0, 5, 5));
ranges.Add(new CellRange(0, 10, 5, 15));
CellSelection selection3 = worksheet.Cells[ranges];
```

**Example 4: Create CellSelection Using Two CellIndex Instances That Specify a CellRange**

```C#
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets.Add();

CellIndex fromIndex = new CellIndex(0, 0);
CellIndex toIndex = new CellIndex(5, 5);
CellSelection selection4 = worksheet.Cells[fromIndex, toIndex];
```

**Example 5: Create CellSelection Using Two Integers That Indicate the CellIndex**

```C#
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets.Add();

CellSelection selection5 = worksheet.Cells[0, 5];
```

**Example 6: Create CellSelection Using Four Integers That Specify the CellRange**

```C#
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets.Add();

CellSelection selection6 = worksheet.Cells[0, 0, 5, 5];
```

Once you have a `CellSelection` object, you can get, set, and clear the properties of the selected cells. For more information about cell properties, see the [Get, Set and Clear Cell Properties](https://www.telerik.com/document-processing-libraries/documentation/libraries/radspreadprocessing/working-with-cells/get-set-clear-properties) article.
