- let temp2 = {
- "0": {
- "0": {
- "value": 1
- },
- "1": {
- "value": 1
- },
- "2": {
- "value": 2,
- "formula": "SUM(A1,B1)"
- }
- }
- }
复制代码- for (let i in temp2) {
- for (let j in temp2[i]) {
- if(temp2[i][j].formula){
- spread.getActiveSheet().setFormula(i, j, temp2[i][j].formula);
- console.log(`spread.getActiveSheet().setFormula(${i}, ${j}, ${temp2[i][j].formula})`)
- }else if(temp2[i][j].value){
- spread.getActiveSheet().setValue(i, j, temp2[i][j].value);
- console.log(`spread.getActiveSheet().setValue(${i}, ${j}, ${temp2[i][j].value})`)
- }
- }
- }
复制代码
公式不计算
|
|