Sixro
Sixro

Reputation: 429

How to copy styles of a cell into another one using Google Spreadsheet API

I'm trying to fill data to a spreadsheet using Google Spreadsheet API. What I do not understand is how can I copy styles from a row (e.g. the first one) to the cells created by my software.

I'm unable to find a way...

Upvotes: 1

Views: 1393

Answers (1)

eddyparkinson
eddyparkinson

Reputation: 3700

Read/write styles use google-apps-script, this is the only way to read and write styles that I have seen.

source.copyTo(ss.getRange('Sheet2!A1'), {formatOnly: true});

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

No styles in Google-spreadsheet-api: It does not have a way to read/write styles to the sheet. I have searched for this.

Read only You can read the styles, by getting the sheet as HTML. Not ideal, but works.

Upvotes: 1

Related Questions