我正在尝试创建按钮'在电子表格的顶部,所以当点击时,阅读器可以跳转到电子表格。我创建了一个编辑日历,并希望能够在表格上跳到不同的月份。这可能吗?
答案 0 :(得分:0)
您无法添加按钮,但可以使用Google Apps脚本添加自定义菜单: https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet#addMenu(String,Object)
您可以使用此Google Apps脚本函数编写跳转脚本:https://developers.google.com/apps-script/reference/spreadsheet/sheet#setActiveSelection(Range)
以下是一个完整的工作示例:
function jumpToJanuary() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
// Now fixed cell - here you can search for specified cell value
var range = sheet.getRange("B4");
sheet.setActiveSelection(range);
};
function onOpen() {
var sheet = SpreadsheetApp.getActiveSpreadsheet();
var entries = [{
name : "Jump to January",
functionName : "jumpToJanuary"
}];
sheet.addMenu("Jump Example Menu", entries);
};