EPPlusSoftware / EPPlus

EPPlus-Excel spreadsheets for .NET
https://epplussoftware.com
Other
1.84k stars 280 forks source link

hope The Range.Copy method will only copy certain ExcelRangeCopyOptionFlag, and currently excludes certain ExcelRangeCopyOptionFlags #1656

Open minren118 opened 1 month ago

minren118 commented 1 month ago

In some cases, the Copy method is used to copy only certain ExcelRangeCopyOptionFlagof , instead of copying all types and excluding certain ExcelRangeCopyOptionFlags. For example, I just want to copy the formula, I don't need to copy anything else.

Like the VBA interface, its special paste is only for a certain type of paste,It's single-choice

image

Finally, there is a special case, that is, the selection is a cell, can not be copied to multiple cells, in the VBA interface, this can be very flexible, and even can be copied to multiple discontinuous Ranges.

The current status of EPPLUS is to copy to the target cell Range, and if the source region is a cell, the copied result is also an top left cell in this continuous region

Sub testCopyMultiRange()

Dim rng As Range

Set rng = Range("G10")
rng.Copy Range("J15:J20,G11:G20")

End Sub
JanKallman commented 1 month ago

Yes, I assume we could add a new overload with a new enum with "include flags" instead. A "copy fill" function or similar is on our enhancement list, see #1271. I'll add this issue you our enhancement project.