In Excel you can Freeze or Split the worksheet in separate panes to either freeze columns or rows or divide the worksheet into different view. To freeze a row/column to fix the the headings you use the `worksheet.View.FreezePanes` method.

## Freeze panes

This sample is taken from Sample 3.4. See [Sample 3.4-C\#](<https://github.com/EPPlusSoftware/EPPlus.Samples.CSharp/tree/master/03-Styling/04-Create a file system report>) or [Sample 3.4-VB](<https://github.com/EPPlusSoftware/EPPlus.Samples.VB/blob/master/03-Styling/04-Create a file system report>) :

```csharp
//Headers
ws.Cells["B1"].Value = "Name";
ws.Cells["C1"].Value = "Size";
ws.Cells["D1"].Value = "Created";
ws.Cells["E1"].Value = "Last modified";
ws.Cells["B1:E1"].Style.Font.Bold = true;

ws.View.FreezePanes(2, 1);
```

```vbnet
'Headers
ws.Cells("B1").Value = "Name"
ws.Cells("C1").Value = "Size"
ws.Cells("D1").Value = "Created"
ws.Cells("E1").Value = "Last modified"
ws.Cells("B1:E1").Style.Font.Bold = True

ws.View.FreezePanes(2, 1)
```

This example will freeze the panes above and to the left of cell A2 in the worksheet, in this case freezing row one.

#### About FreezePanes(1,1)

In Epplus setting the top-left cell, e.g. via `ws.View.FreezePanes(1,1)` Clears the freeze panes from the sheet.

This differs from in Excel where freezing the top-left visible cell creates panes dividing the Excel program window into 4 equal panes.

*Result of freezing A1 in Excel with a small window size causing 10x10 visible cells*

*Please note that freeze panes with F6 selected would in this case achieve the same result*

As Epplus has no UI window, we have no window-size or visible cells to refer to. Therefore Epplus instead calls `ws.View.UnfreezePanes()` instead.

Epplus can however achieve the same result as in the above image in this case by `ws.View.FreezePanes(6,6)`

## Split panes

You can also split the spreadsheet window in two or four panes that are scrollable and resizable. EPPlus can to this by using the `worksheet.View.SplitPanes` or `worksheet.View.SplitPanesPixel` methods. The SplitPanes method will split the window using a row/column input. The SplitPanesPixel method will split the panes using a coordinate in pixels.

This sample will split the windows in two panes after the fourth visible row and the third visible column.

```csharp
ws.View.SplitPanes(4, 3);
```

```vbnet
ws.View.SplitPanes(4, 3)
```

If you only want to split horizontally or vertically you set visible row/column to zero.

```csharp
ws.View.SplitPanes(4, 0);
```

```vbnet
ws.View.SplitPanes(4, 0)
```

## See also

- [Sample 3.4 (C\#)](<https://github.com/EPPlusSoftware/EPPlus.Samples.CSharp/tree/master/03-Styling/04-Create a file system report>) or [Sample 3.4 (VB)](<https://github.com/EPPlusSoftware/EPPlus.Samples.VB/tree/master/03-Styling/04-Create a file system report>)
