Using copyTo

Posted by: aktraverso on 8 September 2017, 9:52 am EST

    • Post Options:
    • Link

    Posted 8 September 2017, 9:52 am EST

    Hello,

    3 questions about copyTo in SpreadJS:

    How can I copy the formula/style of cell A1 to cells from A2 to A100?

    Is it possible copy the formulas/style of one row (e.g. A1:Z1) to multiple rows (e.g. A2:Z100)?

    Is copyTo the most efficient way of copying formulas/styles?

    Thanks a lot

  • Posted 8 September 2017, 9:52 am EST

    Hello,

    Please go through this documentation link which explains how you can copy and paste cells to range in SpreadJS:-

    http://helpcentral.componentone.com/NetHelp/SpreadHClientUG/sccopy.html

    Hope it helps.

    Thanks,

    Reeva

  • Posted 20 November 2019, 4:28 am EST

    Hey Reeva

    Would you please share activate above link or create new link of demo because the link is not working.

    http://helpcentral.componentone.com/NetHelp/SpreadHClientUG/sccopy.html

    Regards,

    Ravish

  • Posted 21 November 2019, 12:22 am EST

    Hi Ravish,

    Please refer to the following API document:

    https://www.grapecity.com/spreadjs/docs/v13/online/SpreadJS~GC.Spread.Sheets.Worksheet~copyTo.html

    Regards

    Sharad

  • 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.

  • Posted 21 December 2022, 11:37 pm EST

    Hi,

    Thanks for sharing suggestions.

    regards,

    Avinash

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels