# Hide Rows and Columns

Learn how to hide or show rows and columns in a worksheet with sample codes using DsExcel.

## Content

You can choose whether to hide or show rows and columns in a worksheet by using the [Hidden](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.IRange.Hidden.html) property of the [IRange](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.IRange.html) interface.
Refer to the following example code in order to hide specific rows and columns in a worksheet.

```csharp
worksheet.Range["E1"].Value = 1;

//Hide row 2:6 using the Hidden property

worksheet.Range["2:6"].Hidden = true;

//Hide column A:D using the Hidden property
worksheet.Range["A:D"].Hidden = true;
```

> !type=note
> Note: The range must either be entire rows or entire columns. The Hidden property doesn't work on a range of cells.