谷歌电子表格没有像 Excel 那样“插入剪切单元格”的功能。
假设我选择了 A4 到 B5,按 Ctrl+X。
然后我将选择移到 A2。
现在我想“插入剪切单元格”,可能是通过插入空白单元格和 moving虚线范围到 A2。
有什么办法可以在 your own menu 上使用 JavaScript 做到这一点吗? ?
例如。
function insertCutOrCopiedCells(){
var SS = SpreadsheetApp.getActiveSpreadsheet();
var sheet = SS.getActiveSheet();
var cell = sheet.getActiveCell();
// How do you get the cells being cut/copied? (ie. A4 to B5)
// We can then insert empty cells (2 cols 2 rows) at the selection (A2)
// and move the cut cells (A4 to B5) there
}
最佳答案
要在 Google 表格中实现插入剪切单元格功能,您只需使用拖放操作。首先突出显示要移动的行,然后将鼠标悬停在行号上(您将看到 手形图标 );然后,按住左键单击并将鼠标悬停在行号上,您将看到一条黑线,插入将发生的位置。松开鼠标按钮,瞧。
关于google-apps-script - Google 电子表格 - 插入剪切/复制的单元格/行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29937294/