LO Basic Macro to copy a cell to the cell below

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.

(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”?

Thank you.

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

@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, Perhaps I should have referred to the function: Fill Single Edit. Not sure what key it’s hooked up to for you.

@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.

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

Hi - Just add to not forget enable ToolsOptionsLibreOfficeAdvancedEnable macro recording


Very cool. Thanks. Worked here.

These macros may do just what you want.

If this answer helped you, please accept it by clicking the check mark :heavy_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.

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.

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

Thank you.

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.

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.