Would like FormatPainter method to copy Styles/Colors/Formats from one range to another

Aug 29, 2012 at 8:13 PM

I would like a built-in .FormatPainter method in EPPlus to copy styles/colors/formats/borders from one range to another.  Something like...

pkg.Workbook.Worksheets(1).FormatPainter("A:1,B:5", "C:1,D:5")

pkg.Workbook.Worksheets(1).FormatPainter("1:1", "2:50")

Or does someone already have a function to do this?


Aug 30, 2012 at 5:13 PM
Edited Aug 30, 2012 at 5:13 PM

Well for copying rows, I'm now using .InsertRows(startRow, numberOfRows, copyFormatFromRow)

The only problem is it doesn't adjust the Row Height of inserted rows to match copyFormatFromRow

Aug 31, 2012 at 6:10 AM

I guess we could add that later on, but for now you can copy the StyleID property to the range you want to format.