Epplus cell range numerically

sarsnake picture sarsnake · Jan 11, 2016 · Viewed 12.5k times · Source

In EPPlus extension, if I need to set style for a range of cells such as A1 to C1, I will use the following

ws.Cells["A1:C1"].Style.Font.Bold = true;

What is the equivalent for this using numbers only?

Answer

Ernie S picture Ernie S · Jan 12, 2016

Cells has an overload that will let you do [FromRow, FromCol, ToRow, ToCol] like this:

ws.Cells[1, 1, 1, 3].Style.Font.Bold = true;