我很抱歉問這個問題,我一直在做這麼多的閱讀。該腳本確實完成,但不清除選定的單元格。我做錯了什麼?請幫忙?腳本沒有清除單元格
// Display a dialog box with a message and "Yes" and "No" buttons.
var ui = SpreadsheetApp.getUi();
var response = ui.alert('Are you sure you want to continue?', ui.ButtonSet.YES_NO);
// Process the user's response.
if (response == ui.Button.YES) {
Logger.log('The user clicked "Yes."');
} else {
Logger.log('The user clicked "No" or the dialog\'s close button.');
}
function clearRange() {
//replace 'Sheet1' with your actual sheet name
var sheet = SpreadsheetApp.getActive().getSheetByName('LOAD ASSIGNMENT');
sheet.getRange('A4:L120').clearContent();
}
你是如何得到這段代碼運行的?你看到消息框嗎?有沒有更多的代碼沒有發佈? – ScampMichael 2015-04-02 14:34:38
你想清除哪個細胞?在您的代碼上方您的代碼中,您提到了您的代碼給出單元格的選定單元格 – ScampMichael 2015-04-02 14:53:00