Google apps script 自定义函数Google Sheets,用于显示包含来自另一个单元格的值的消息
我一直在做这个函数,希望在弹出的消息中显示特定单元格的值 这个单元格与“当前单元格”在同一行,如果这有什么帮助的话,我只是非常困惑,甚至不确定这是否可能Google apps script 自定义函数Google Sheets,用于显示包含来自另一个单元格的值的消息,google-apps-script,google-sheets,google-sheets-custom-function,Google Apps Script,Google Sheets,Google Sheets Custom Function,我一直在做这个函数,希望在弹出的消息中显示特定单元格的值 这个单元格与“当前单元格”在同一行,如果这有什么帮助的话,我只是非常困惑,甚至不确定这是否可能 function my2ndFunction() { var cell = SpreadsheetApp.getCurrentCell(); var ui = SpreadsheetApp.getUi(); var response = ui.alert('Do you want to start?', '', ui.ButtonS
function my2ndFunction() {
var cell = SpreadsheetApp.getCurrentCell();
var ui = SpreadsheetApp.getUi();
var response = ui.alert('Do you want to start?', '', ui.ButtonSet.YES_NO);
var output;
if (response == ui.Button.YES) {
cell.setValue(new Date());
}
}
谢谢你的关注 您只需在if条件中添加另一条警报消息,如下所示:
function my2ndFunction() {
var cell = SpreadsheetApp.getCurrentCell();
var ui = SpreadsheetApp.getUi();
var response = ui.alert('Do you want to start?', '', ui.ButtonSet.YES_NO);
var output;
if (response == ui.Button.YES) {
cell.setValue(new Date());
ui.alert('The current date is: ' + new Date())
}
}
您只需在if条件中添加另一条警报消息,如下所示:
function my2ndFunction() {
var cell = SpreadsheetApp.getCurrentCell();
var ui = SpreadsheetApp.getUi();
var response = ui.alert('Do you want to start?', '', ui.ButtonSet.YES_NO);
var output;
if (response == ui.Button.YES) {
cell.setValue(new Date());
ui.alert('The current date is: ' + new Date())
}
}
请记住,当一个答案回答你的问题时,它甚至是它,这样其他人也可以受益。请记住,当一个答案回答你的问题时,它甚至是它,这样其他人也可以受益。