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

对着背影说爱祢 提交于 2021-02-07 10:20:42

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/18419939/how-to-copy-styles-of-a-cell-into-another-one-using-google-spreadsheet-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!