如何使一个按钮跳转到一个特定的细胞在另一片在谷歌小号preadsheet? [英] How to make a button to jump to a specific cell in another sheet in Google Spreadsheet?

查看:207
本文介绍了如何使一个按钮跳转到一个特定的细胞在另一片在谷歌小号preadsheet?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个谷歌小号preadsheet许多表和目录表。是否有某种方式在主表创建一个按钮,这样一个点击可以直接进入到另一个工作表的单元格?

I have a Google spreadsheet with many sheets and a table of contents. Is there some way to create a button in the main sheet so that with a click one can go directly to the cell in another sheet?

我想通了,使按键的方式以及分配脚本的按钮。

I figured out the way to make button and assigned the script to the button.

我修改的脚本变成这个样子,但我在最后一行的问题,我该怎么办?

I modified a script to become like this, but I have problem on the last line, what should I do?

function goToSheet2b() {
  goToSheet("8601-10!N1");
}

function goToSheet(sheetName) {
  var sheet = SpreadsheetApp.getActive().getSheetByName(sheetName);
  SpreadsheetApp.setActiveSheet(sheet);
}

PS:8601-10是另一片我需要去的名称

PS: 8601-10 is the name of the other sheet I need to go to.

感谢您的帮助。

推荐答案

您不能在工作表名称的单元格引用。你要送他们作为独立变量。

You can't have the cell reference in the sheet name. You have to send them as separate variables.

function goToSheet2b() {
  // 1 = row 1, 14 = column 14 = N
  goToSheet("8601-10", 1, 14);
}

function goToSheet(sheetName, row, col) {
  var sheet = SpreadsheetApp.getActive().getSheetByName(sheetName);
  SpreadsheetApp.setActiveSheet(sheet);
  var range = sheet.getRange(row, col)
  SpreadsheetApp.setActiveRange(range);
}

这篇关于如何使一个按钮跳转到一个特定的细胞在另一片在谷歌小号preadsheet?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆