是否可以创建宏按钮以在 Google 表格中导航? [英] Is it possible to create macro buttons to navigate in Google Sheets?

查看:12
本文介绍了是否可以创建宏按钮以在 Google 表格中导航?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过以下链接在 Google 表格中创建一个数据库:

我们可以使用插入/绘图来绘制我们绘图的图像.

在这种情况下,我使用的是基本形状.如果您愿意,可以添加文本.

现在只需保存并关闭即可.

将按钮拖到您想要的位置,然后单击右上角的三个按钮.选择分配脚本.

复制脚本名称.

将其粘贴到对话框中,然后单击确定.

尝试单击该按钮,它应该会将您带到最左侧的页面,除非您已经在那里.

I am creating a database in Google Sheets per the link below:

Database

I would like to add buttons like you can in excel where you can record a macro to navigate or open another sheet or perform a particular function. For example in my database, I could create a home page with buttons to open certain sheets. I could then hide all of the sheets and only have a home page.

Or, perhaps hide the query data in cell C2 in the 'Other Attendances' sheet and create a button to open up the query.

Is any of this possible in Google Sheets?

解决方案

Let's create a button to go to the left hand most page. Please select one of the right hand pages or push the + sign in the lower left to create one.

Here's the script:

function gotoMostLeftPage() {
  var ss=SpreadsheetApp.getActive();
  ss.setActiveSheet(ss.getSheets()[0]);
}

Now we need a button:

We can use insert/Drawing to draw an image of our drawing.

In this case I'm using a basic shape. You can add text if you like.

Now just save and close.

Drag the button to where you want it and click on the three buttons in the upper right. Select Assign script.

Copy the script name.

Paste it into the dialog and click ok.

Try clicking on the button and it should take you to the left most page unless you are already there.

这篇关于是否可以创建宏按钮以在 Google 表格中导航?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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