在谷歌脚本中执行函数之后,选择/突出显示下一个相邻的单元格 [英] Selecting/highlighting next adjacent cell in row after function has been executed in google script

查看:101
本文介绍了在谷歌脚本中执行函数之后,选择/突出显示下一个相邻的单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有真正的编码经验,所以我提前道歉,如果这是一个愚蠢的问题,并有明显的答案... ...

我使用谷歌表保留跟踪工作中的事情,我的员工每天多次使用它。他们会将三个短语中的一个键入到一行中的某个单元格中,所以我使用绘图功能创建了按钮,只需单击它们即可将适当的文本插入到突出显示的单元格中。

一旦将这段文本插入到单元格中,我想添加一些东西到自动选择该行中的下一个相邻单元格的函数的末尾(向右),所以他们可以继续输入。目前,一旦他们点击按钮将文本插入到一个单元格中(例如B23),他们必须使用鼠标手动选择C23,然后再键入该单元格。出于某种原因,您不能使用键盘上的右箭头键或Tab键移动,所以我想知道是否有方法将选择过程添加到脚本中(甚至是用于允许选项卡或右箭头键的解决方法上班)。

我意识到这可能看起来像一个乏味的问题,人们可能会认为我非常懒惰的要求一种更有效的方式转移到一个单元格,而不是使用鼠标,但我的员工每天使用这张表几百次,所以我真的很想尽量提高他们的效率,让他们尽可能方便和方便。输入数据可能很乏味,所以我试图简化一些东西,并尽可能减少痛苦:)

非常感谢!

解决方案

有几种方法可以选择右侧的单元格。一种方法是使用偏移量(rowOffset,columnOffset)

  range.offset(0,1)


I am not really experienced with coding so I apologize in advance if this is a stupid question with an obvious answer...

I use a google sheet to keep track of things at work, and my employees use it multiple times a day. They will either type one of three phrases into a certain cell on a row, so I have created buttons using the drawing feature that they can simply click, which will insert the appropriate text into the highlighted cell.

Once this text is inserted into the cell, I would like to add something to the end of the function that automatically selects the next adjacent cell in the row (to the right) so they can continue typing in. Currently, once they click the button to insert text into one cell (e.g., B23) they have to use the mouse to manually select C23 before typing into that cell. For some reason you cannot use the right arrow key or tab key on the keyboard to move over, so I am wondering if there is a way to add the selecting process into the script (or even a workaround for allowing the tab or right arrow keys to work).

I realize this may seem like a tedious question and folks may think it is awfully lazy of me to ask for a more efficient way to move over to a cell than using the mouse, but my employees use the sheet hundreds of times a day, so I'd really like to maximize the efficiency for them to make it as easy and convenient as possible. Inputting data can be tedious enough, so I am trying to simplify things and make it as least painful as possible :)

Thanks so much!

解决方案

There are several ways to select the cell at the right. One way is to use offset(rowOffset,columnOffset):

range.offset(0,1)

这篇关于在谷歌脚本中执行函数之后,选择/突出显示下一个相邻的单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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