Posted 21 December 2022, 12:04 pm EST
For those who also struggle with the copyTo functionality:
The documentation
https://help.grapecity.com/spread/SpreadSheets10/JavascriptLibrary~GC.Spread.Sheets.Worksheet~copyTo.html
isn´t very clear what parameter takes care about what.
But I figured it out and want to share my findings.
a) “fromRow”, “fromColumn” and “rowCount”, “columnCount”
(= parameters 1, 2, 5, and 6) are describing the source
while
b) “toRow” and “toColumn”
(= parameters 3 and 4) are describing the destination cell
aka the “top left cell” where it will be pasted.
This means the copyTo(…) function copies an area (defined by parameters 1, 2, 5 and 6) ONCE to the destination (defined by the parameters 3 and 4).
Conclusion:
Copying the cell “A1” to cells from “A2” to “A100” needs a loop.
CopyTo(…) is not capable to solve this with one call.
Hope this helps.