我想在电子表格的顶部创建“按钮”,所以点击时,读者可以在电子表格中跳来跳去。香港专业教育学院创建了一个编辑日历,并希望能跳转到不同月份在纸张上。这可能吗?
您不能添加按钮,但你可以使用谷歌Apps脚本添加自定义菜单:https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet#addMenu(String,Object)
您可以使用此谷歌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);
};