3
votes

I want to define a list of columns as an Excel PrintArea (by EPPlus, c#). I can define interval (first and last column of area) but I don't know how to define separate columns (for instance: A, C, F, G).

I can set interval like this:

listSheet.PrinterSettings.PrintArea = listSheet.Cells["A,G"];
1

1 Answers

6
votes

PrintArea is an ExcelRangeBase so you can set it link any other range:

listSheet.PrinterSettings.PrintArea = listSheet.Cells["A:A,G:G"];