[Solved] Calc Macro to copy & paste cells

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
boyurboy
Posts: 3
Joined: Thu Sep 02, 2010 3:27 am

[Solved] Calc Macro to copy & paste cells

Post by boyurboy »

Hello, all!

I cannot for the life of me figure this out quickly enough, so any help is greatly appreciated.

I need to cut cell contents (including formatting) for the currently selected cell in one sheet (from a table that is 6x80 cells)
and paste it to the first empty row on a list (one column in a separate sheet). I suspect about 200 of the values in the first sheet will be selected and pasted to the list.

I want to bind the macro to do this to a simple button, that way the user can select a cell, hit the button, and be done. Any notions on how to build the macro? I am an absolute novice at this, and my attempts to implement on my own have been futile. Thanks in advance!

- B.
Last edited by Hagar Delest on Thu Sep 02, 2010 4:55 pm, edited 1 time in total.
Reason: tagged [Solved].
OpenOffice 3.2 on Windows 7
User avatar
Charlie Young
Volunteer
Posts: 1559
Joined: Fri May 14, 2010 1:07 am

Re: Calc Macro Help

Post by Charlie Young »

My attached example is hardly the only way to do this, and maybe more complicated than necessary. My "table" on sheet one, that is, the valid cells for copying from, is A2:A37, I have included various formatting in the characters there. The destination column is Column A of Sheet2. Hopefully it will be easy to modify to your exact purpose, but don't be afraid to ask questions here.
Attachments
Copy_By_Button.ods
Push button to copy cell
(11.77 KiB) Downloaded 3078 times
Apache OpenOffice 4.1.1
Windows XP
boyurboy
Posts: 3
Joined: Thu Sep 02, 2010 3:27 am

Re: Calc Macro Help

Post by boyurboy »

Thanks for the help! I think this is solved!
OpenOffice 3.2 on Windows 7
AndresAprende
Posts: 1
Joined: Fri Aug 05, 2016 7:21 pm

Re: [Solved] Calc Macro to copy & paste cells

Post by AndresAprende »

Thanks Charlie
LibreOffice Versi??n: 5.1.4.2 Id. de compilaci??n: 1:5.1.4-0ubuntu1
Post Reply