Marc L
Marc L

Reputation: 887

Copy values and formulas to a different sheet in google script

I am trying to copy the full data from one sheet to another including all the values and all the formulas. The problem I have is that I cannot find a function that does both setValues is just the values, setFormulas just the formulas. Is there a way to combine both of these into a single copy so all the information comes across. if it includes the formatting information that would be even better.

Thanks

Upvotes: 0

Views: 1730

Answers (1)

alfiethecoder
alfiethecoder

Reputation: 333

Would this help? It duplicates an entire sheet?

https://developers.google.com/apps-script/reference/spreadsheet/sheet#copyTo(Spreadsheet)

and if it doesn't, could you use the copyTo function of range?

https://developers.google.com/apps-script/reference/spreadsheet/range#copyTo(Range)

Upvotes: 1

Related Questions