dot*_*hen 8 keyboard openoffice-calc openoffice libreoffice libreoffice-calc
如何使用键盘将一行移动到不同的位置?我找到了这个鼠标指南,但由于残疾,我在使用鼠标时遇到了麻烦。
请注意,我不打算“手动排序”,并且使用额外的“排序序号”列不是可行的解决方法。不过,我知道 Calc 出色的排序能力。
小智 14
在 Open Office Calc 中移动一行:
如果要覆盖和销毁目标位置,请不要按住 ALT 键。只需单击突出显示的行并拖动到它的新位置。目标位置的数据将被销毁并替换为正在移动的行的数据。
我不确定是否有办法使用键盘“移动”行,但是使用 c&p 和使用键盘插入/删除行应该提供相同的功能:
Insert菜单;由于剪切和粘贴操作有时很烦人,您可以创建一个简单的宏来剪切单元格,然后再创建一个来粘贴它们,将现有内容向下移动。
这是一个非常简单的代码来“移动”选定的单元格:
Option Explicit
Sub CopyAndCut
' ---------------------------------------------------------
' define variables
Dim document as object
Dim dispatcher as Object
Dim oSelections As Object
' ---------------------------------------------------------
' get access to the document and selections (if any)
document = ThisComponent.CurrentController.Frame
oSelections = ThisComponent.getCurrentSelection()
If IsNull(oSelections) Then Exit Sub
' ---------------------------------------------------------
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
dispatcher.executeDispatch(document, ".uno:Cut", "", 0, Array())
' -------------------------------------------------------------
' Check the width of the selection - if 1024 columns, we assume
' the complete row was selected and should get deleted
If 1024 = oSelections.Columns.getCount() Then
dispatcher.executeDispatch(document, ".uno:DeleteRows", "", 0, Array())
End If
End Sub
Sub InsertWithMoveDown
' ---------------------------------------------------------
' define variables
Dim document as object
Dim dispatcher as object
' ---------------------------------------------------------
' get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
' ---------------------------------------------------------
' Paste contents with "Move Down" option
Dim args1(5) as New com.sun.star.beans.PropertyValue
args1(0).Name = "Flags"
args1(0).Value = "A"
args1(1).Name = "FormulaCommand"
args1(1).Value = 0
args1(2).Name = "SkipEmptyCells"
args1(2).Value = false
args1(3).Name = "Transpose"
args1(3).Value = false
args1(4).Name = "AsLink"
args1(4).Value = false
args1(5).Name = "MoveMode"
args1(5).Value = 0
dispatcher.executeDispatch(document, ".uno:InsertContents", "", 0, args1())
End Sub
Sub InsertWithMoveRight
' ---------------------------------------------------------
' define variables
Dim document as object
Dim dispatcher as object
' ---------------------------------------------------------
' get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
' ---------------------------------------------------------
' Paste contents with "Move Right" option
Dim args1(5) as New com.sun.star.beans.PropertyValue
args1(0).Name = "Flags"
args1(0).Value = "A"
args1(1).Name = "FormulaCommand"
args1(1).Value = 0
args1(2).Name = "SkipEmptyCells"
args1(2).Value = false
args1(3).Name = "Transpose"
args1(3).Value = false
args1(4).Name = "AsLink"
args1(4).Value = false
args1(5).Name = "MoveMode"
args1(5).Value = 1
dispatcher.executeDispatch(document, ".uno:InsertContents", "", 0, args1())
End Sub
Run Code Online (Sandbox Code Playgroud)
复制代码到你的用户库,只是分配后CopyAndCut到,例如,Alt+ C,InsertWithMoveDown以便例如,Alt+ V,及 InsertWithMoveRight到,例如,Alt+ R(所有这些快捷键默认为空)。
现在,您可以使用鼠标或键盘选择单元格或行,使用Alt+剪切它们C,移动到目标单元格,然后使用Alt+V或Alt+粘贴它们R。
| 归档时间: |
|
| 查看次数: |
11609 次 |
| 最近记录: |