简体   繁体   English

谷歌表提交按钮到一个新的表

[英]google sheets submit button to a new sheet

I am working on an inventory sheet that will allow me to input data into one sheet, hit a button and this button will clear data and then append it to the next sheet in a specified column. 我正在处理一个库存表,它将允许我将数据输入到一张表中,单击一个按钮,然后该按钮将清除数据,然后将其附加到指定列中的下一张表中。 I have to keep inventory of 10 items so there will be 10 columns that I would like this data continuously added to. 我必须保留10个项目的库存,因此我希望将10个列连续添加到此数据中。

function onEdit(e){
// Set a comment on the edited cell to indicate when it was changed.
if(e.range.getA1Notation() === 'B7'){
var input = e.range.getValue();
e.range.clearContent();

var sheet = SpreadsheetApp.getActiveSpreadsheet();
var inputSheet = sheet.getSheetByName("input")
var masterSheet = sheet.getSheetByName("master inventory");

var currentRow = inputSheet.getRange("C7").getValue(); 

masterSheet.getRange("A3:A1000").getCell(currentRow, 1).setValue(input);
inputSheet.getRange("C7").setValue(currentRow + 1);
}
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM