Google表脚本有关使用下拉列表移动到另一个选项卡
这是我想做的事情的视频。
[https://soapbox.wistia.com/videos/rvdnwfkiuw] [1]
yt视频我要复制是
这是他正在使用的脚本。
脚本:
function onEdit(e) {
const src = e.source.getActiveSheet();
const r = e.range;
if (r.columnStart != 3 || r.rowStart == 1 || e.value == src.getName()) return;
const dest = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(e.value);
src.getRange(r.rowStart,1,1,3).moveTo(dest.getRange(dest.getLastRow()+1,1,1,3));
src.deleteRow(r.rowStart);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它像这样使用了一个简单的触发器。
无需创建可安装的触发器。我从列表Sheet1,Sheet2中放入Sheep0第3列中的数据瓦化,而且效果很好。
演示:
It works like this just using a simple trigger.
NO Need to create an installable trigger. I put a dataValidation in Sheet0 column 3 from a list Sheet1,Sheet2 and it works just fine.
Demo:
您需要创建一个触发允许脚本执行更改一旦您在下拉菜单上进行更改。
示例:
在此图像中,我使用了视频中显示的相同脚本,然后将其添加为脚本的触发器。请注意,它被添加为
oneDit
触发类型的类型:You need to create a Trigger to allow the script to perform the changes once you make a change on the drop down menu.
Example:
In this image I used the same script shown in the video and I added it as a trigger for the script. Note that it was added as an
OnEdit
type of trigger: