# Cells

## Content



The [XLSheet](/componentone/api/wpf/online-excel/dotnet-framework-api/C1.WPF.Excel.4.6.2/C1.WPF.Excel.XLSheet.html) object also contains cells that can be accessed using an indexer that takes row and column indices. The cells are represented by [XLCell](/componentone/api/wpf/online-excel/dotnet-framework-api/C1.WPF.Excel.4.6.2/C1.WPF.Excel.XLCell.html) objects that contain the cell value and style.

As with rows and columns, the cell indexer also extends the sheet automatically. For example, write:

```vbnet
Dim cell As XLCell = sheet(10, 10)
```

```csharp
XLCell cell = sheet[10,10];
```

If the sheet has fewer than 11 rows and 11 columns, rows and columns will be added and a valid **XLCell** object will be returned.

Because the sheet expands automatically, this indexer will never return a **null** reference. If you want to check whether a particular cell exists on the sheet and you don't want to create the cell inadvertently, use the sheet's [GetCell](/componentone/api/wpf/online-excel/dotnet-framework-api/C1.WPF.Excel.4.6.2/C1.WPF.Excel.XLSheet.GetCell.html) method instead of the indexer.

**XLCell** objects have a [Value](/componentone/api/wpf/online-excel/dotnet-framework-api/C1.WPF.Excel.4.6.2/C1.WPF.Excel.XLCell.Value.html) property that contains the cell contents. This property is of type **object** and it may contain strings, numeric, Boolean, DateTime, or null objects. Other types of objects cannot be saved into Excel files.

**XLCell** objects also have a [Style](/componentone/api/wpf/online-excel/dotnet-framework-api/C1.WPF.Excel.4.6.2/C1.WPF.Excel.XLCell.Style.html) property that defines the appearance of the cell. If the **Style** property is set to **null**, the cell is displayed using the default style. Otherwise, it should be set to an **XLStyle** object that defines the appearance of the cell (font, alignment, colors, format, and so on).