Google脚本-如何仅使复印表值?

问题描述

我尝试每天自动复印一张纸。这是很好的工作,但我不想复制公式,我只想要值。 如何在不更改源表的情况下将更改公式更改为新文件中的值?

这是我写的代码

function makecopy() {

// generates the timestamp and stores in variable formattedDate as year-month-date hour-minute-second
var formattedDate = Utilities.formatDate(new Date(),"GMT","yyyy-MM-dd' 'HH:mm:ss");

// gets the name of the original file and appends the word "copy" followed by the timestamp stored in formattedDate
var name = SpreadsheetApp.getActiveSpreadsheet().getName() + " copy " + formattedDate;

// gets the destination folder by their ID. REPLACE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx with your folder's ID that you can get by opening the folder in Google Drive and checking the URL in the browser's address bar
var destination = DriveApp.getFolderById("1JJfoq4OFiTgRPgY90eB5lUrspa4GeDK9");
    
// gets the current Google Sheet file
var file = DriveApp.getFileById(SpreadsheetApp.getActiveSpreadsheet().getId())
// makes copy of "file" with "name" at the "destination"
file.makecopy(name,destination);

};

i have script that change the currect sheet,i want to change the **new sheet** i got from the script before and make value only new sheet
***
// convert all formulas to values in the active sheet
function formulasTovaluesActiveSheet() {
  var sheet = SpreadsheetApp.getActiveSheet();
  var range = sheet.getDatarange();
  range.copyValuesToRange(sheet,1,range.getLastColumn(),range.getLastRow());
};

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)