I am using EPPlus in my .Net project to output some data into an Excel worksheet.

Suppose I wanted to format Columns E-G with a specific format. Using EPPlus, I know I can do it as follows:

wks.Cells("E:G").Style.Numberformat.Format = ...

Now, I'm wondering, suppose I wanted to do the same, but by referencing the columns by their index numbers rather than their alphabetical representation - In theory something looking like this:

wks.Columns("5:7").Style.Numberformat.Format = ...

Now, I know that it would work if I did something like this:

wks.Cells(1,5,wks.Dimension.End.Row,7).Style.Numberformat.Format = ...

But I'm hoping there's a better / nicer way to do this in EPPlus. Any thoughts / suggestions?

Thanks!!

Edit
Report