Zdravo!
Calc ima v makrih drug jezik kot Excel, zato pojma nimam, kako bi v Calc-u v stolpcu "B" našel prvo prazno celico in kurzor pomaknil še eno navzdol.
Prva prazna celica
Preuredil sem makro. Malo poizkusov s celicami, pa gre (čeprav mi tale jezik ni najbolj domač )
![Embarassed :oops:](./images/smilies/icon_redface.gif)
Koda: Izberi vse
sub KopirajObmocje
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
args1(0).Name = "By"
args1(0).Value = 7
dispatcher.executeDispatch(document, ".uno:GoLeft", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ToPoint"
args2(0).Name = "By"
args2(0).Value = 10
dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, args2())
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
end sub