在选定的单元格之前添加行
我想创建一个脚本,可以在其中添加行(在上一行中)选择一个单元格。
对于典范,我有一个带有50行的表格。如果我选择第32行并启动脚本,我想在第32行中添加一个新行,最后,在我的标签中有51行。
经过网络的研究,我什么也没发现。我可能不知道该如何搜索,因为我是法国人,也许我对此用了坏话。
这是我代码的开始,但这是不起作用的...
function ajoutLigne(e) {
const classeur = SpreadsheetApp.getActiveSpreadsheet();
const feuille = classeur.getActiveSheet();
const ui = SpreadsheetApp.getUi();
var rowIndex = feuille.getRange(e).index();
Logger.log(rowIndex);
}
谢谢您的帮助
I would like to create a script where i can add row (in the previous row) where I select a cell.
For exemple, I have a tab of sheet with 50 rows. If i select the 32th row and launch my script, i would like to add a new row in this 32th row and, finally, have 51 rows in my tab.
After researchs in web, i don't find anything about that. It's possible i don't know how to search because i'm french and probably i used bad words for that.
This is the beginning of my code but it's don't work ...
function ajoutLigne(e) {
const classeur = SpreadsheetApp.getActiveSpreadsheet();
const feuille = classeur.getActiveSheet();
const ui = SpreadsheetApp.getUi();
var rowIndex = feuille.getRange(e).index();
Logger.log(rowIndex);
}
Thank you for advance to your help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试:
这将获得活动行的索引,然后插入空白行。
Try:
This will get the index of the active row, and insert a blank row.