We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question

LO Basic Macro to copy a cell to the cell below [closed]

asked 2017-05-10 08:57:28 +0200

inJesus gravatar image

updated 2017-05-10 09:43:19 +0200

Hi, would be nice if someone wants to provide this to me. I do not manage to do this step with recording a macro.

Cell content is a formula which shall just be pasted in the cell below.

Lupp has already made a pasting macro for me so the copying macro would be enough I guess.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-11-28 01:00:20.080715


(To call a macro for the purpose is more complicated than to do it manually. Conclusion: The macro will be called by anoter macro.)
In what way shall the macro come to know the cell to copy: Active cell? Selected cell? Cell passed as an object? Cell position passed by numeric parameters? Cell name (address) passed?
Is there a need to test for a "single-cell-assurance" kept?
Is there a need to test for the content cell.Type to be 3 meaning "content is formula"?

Lupp gravatar imageLupp ( 2017-05-10 11:44:43 +0200 )edit

Thank you.

inJesus gravatar imageinJesus ( 2017-05-10 12:31:11 +0200 )edit

In Calc, you can use the keyboard shortcut Ctrl-' (Control tick) to copy from the cell above.

EasyTrieve gravatar imageEasyTrieve ( 2017-05-10 23:04:00 +0200 )edit

@EasyTrieve: This does not work with my German keyboard. (The shortcut is defined by default. Don't worry. I will not try to use the command.)

Lupp gravatar imageLupp ( 2017-05-10 23:55:36 +0200 )edit

@Lupp, Perhaps I should have referred to the function: Fill Single Edit. Not sure what key it's hooked up to for you.

EasyTrieve gravatar imageEasyTrieve ( 2017-05-11 00:47:18 +0200 )edit

@EasyTrieve: we are talking of the same command. I am working with English (UK) UI but with German keyboard. The shortcut Ctrl+' is defined but does not work. On my keyboard ' is Shift+#.
But if I delete this shortcut and replace it with Shift+Ctrl+' it doesn't work either. However, I can assign the command to some different key combination. It does work with Ctrl+F, e.g.

Lupp gravatar imageLupp ( 2017-05-11 01:23:21 +0200 )edit

3 Answers

Sort by » oldest newest most voted

answered 2017-05-10 10:54:37 +0200

JohnSUN gravatar image

You can record this macro yourself. Try it, it's not difficult. You just need to write only one action - pressing the key combination Ctrl+D CreateMacroToCopyCell.gif

edit flag offensive delete link more



Hi - Just add to not forget enable ToolsOptionsLibreOfficeAdvancedEnable macro recording


pierre-yves samyn gravatar imagepierre-yves samyn ( 2017-05-10 11:00:54 +0200 )edit

Very cool. Thanks. Worked here.

inJesus gravatar imageinJesus ( 2017-05-10 12:30:16 +0200 )edit

answered 2017-05-10 09:34:00 +0200

robleyd gravatar image

These macros may do just what you want.

If this answer helped you, please accept it by clicking the check mark ✔ to the left and, karma permitting, upvote it. If this resolves your problem, close the question, that will help other people with the same question.

edit flag offensive delete link more


Thank you. I do not know Pyhton or can use it, only Basic in LibreOffice. And I want to integrate it in an existing macro.

inJesus gravatar imageinJesus ( 2017-05-10 09:37:04 +0200 )edit

You just need to install the macros in the link to use them.No need to integrate; the functionality is all there.

robleyd gravatar imagerobleyd ( 2017-05-10 10:44:24 +0200 )edit

Thank you.

inJesus gravatar imageinJesus ( 2017-05-10 12:33:08 +0200 )edit

answered 2018-03-18 11:18:07 +0200

David gravatar image

As of LibO Calc (that's what I've got, anyway), this is "built-in" as a standard keyboard shortcut:

  • CTRL+' in Win and Linux;
  • CMND+' in OSX.

(That's "apostrophe", btw.) Works quite nicely. No need for macros.

edit flag offensive delete link more



You may want to read the comments by @EasyTrieve and by @Lupp (myself) on the original question.

For exactly the operation described in the OQ I actually use the slightly longer key sequence Shift+ArrowDown, Ctrl+D.

Lupp gravatar imageLupp ( 2018-03-18 12:01:38 +0200 )edit

Question Tools

1 follower


Asked: 2017-05-10 08:57:28 +0200

Seen: 1,009 times

Last updated: Mar 18 '18