我正在使用Google表格和Awesome Table Build 一个库,并希望创建一个脚本来自动签署项目的过程 .

这是电子表格:https://docs.google.com/spreadsheets/d/1xET-QGTj97yGj9H4-Mesu7aV_b0CJCGjcKnOHgE2W8g/edit?usp=sharing

因此,正如您所看到的,“数据库”表按行详细说明了库中的每个项目 . 在“主页”工作表中,用户键入(或扫描)项目编号,该项目编号将提取数据,扫描名称,然后手动键入下面的绿色框(在第11行中) .

第14行提取源电子表格中存在的数据 . 我想要做的是使用绿色框和名称(单元格D5)复制/粘贴到特定项目的相应行中的源电子表格,功能类似于双向查询 .

我在绿色框旁边制作了参考单元格,指示我想要相邻单元格中的内容的单元格地址 .

这是我发现的复制和粘贴脚本,可能是解决方案的一部分:

function Copy() {
    var sss = SpreadsheetApp.openById('spreadsheet_key'); //replace with source ID
    var ss = sss.getSheetByName('Source'); //replace with source Sheet tab name
    var range = ss.getRange('A2:E6'); //assign the range you want to copy
    var data = range.getValues();
    var tss = SpreadsheetApp.openById('spreadsheet_key'); //replace with destination ID
    var ts = tss.getSheetByName('SavedData'); //replace with destination Sheet tab name
    ts.getRange(ts.getLastRow()+1, 1,5,5).setValues(data); //you will need to define the size of the copied data see getRange()
}

任何有关此的帮助或建议表示赞赏!也许有一种更简单的方法?当我尝试录制宏时,我无法让它工作 .