sub fuenfnachrechts
rem define variables
dim document as object
dim dispatcher as object
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args2(1) as new com.sun.star.beans.PropertyValue
args2(0).Name = "By"
args2(0).Value = 5
args2(1).Name = "Sel"
args2(1).Value = true
dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, args2())
end sub
Sub fuenf_nach_rechts
oZell = thisComponent.getcurrentSelection()
if not oZell.supportsService("com.sun.star.sheet.SheetCell") then
msgbox "Bitte nur eine Zelle markieren (aktivieren)!", 48, "Fehler in Selektion!"
exit Sub
end if
doc=thisComponent
blatt = doc.sheets(0)
oCelle=doc.getCurrentSelection().getCellAddress()
oRow=oCelle.Row ' aktuelle Zeile(Index)
oColumn=oCelle.column ' aktuelle Spalte(Index)
oColumn = oColumn + 5 'Spalte um 5 erhöhen
nCell = blatt.getCellByPosition(oColumn, oRow) 'aktuellen Cursor auf die o.a. Position setzen
doc.CurrentController.Select(nCell)
End Sub