[Solved] Macro for copy datas from more files in another one

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
savezin
Posts: 7
Joined: Thu Feb 04, 2021 6:01 pm

[Solved] Macro for copy datas from more files in another one

Post by savezin »

Good evening,
I ask you for help, because I have been trying for days, but I have not come out of it. :to knock:
I created a calc oo model for filing jobs, my idea was to group data from the various tabs, all inside another calc file as accounting, USING A MACRO.
I know that it would be much easier to use a database, but the problem is that oo for android (system I would like to use it on) there is no database.
So I would like to use Calc.
I am attaching the files to get an idea for the macro.
My idea was to merge several files created by the PROVA NUOVA.ods in (C: / USERS / UTENTE / DESKTOP /) folder and with a macro, inserted in the CONTABILITà MENSILE.ods file, extrapolate the data present in cells B3, F3, P3, of the SCHEDA page of the PROVA NUOVA.ods file and put them in cell A7 of CONTABILITà MENSILE.ods
Is there any pious soul who could help me out?
Thanks in advance
Attachments
PROVA NUOVA.ods
(22.14 KiB) Downloaded 214 times
CONTABILITA MENSILE - Copia.ods
(14.98 KiB) Downloaded 210 times
Last edited by Hagar Delest on Sat Feb 27, 2021 8:11 pm, edited 2 times in total.
Reason: tagged solved
andr openoffice 4.6.0 android e win10pro
Bidouille
Volunteer
Posts: 575
Joined: Mon Nov 19, 2007 10:58 am
Location: France

Re: Macro for copy datas from more files in another one

Post by Bidouille »

You must use DataArray property to do this.
Try a search with "insert from sheet", you will find some examples.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Macro for copy datas from more files in another one

Post by Villeroy »

Configurable solution for all types of spreadsheets and csv: Merge sheets of spreadsheet documents
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
savezin
Posts: 7
Joined: Thu Feb 04, 2021 6:01 pm

Re: Macro for copy datas from more files in another one

Post by savezin »

Thank you Villeroy, your solution is exactly what I was looking for, but I followed your instuctions and the macro imports all the data that there are in files. Is there an option to import only some cells value on the same line,in order to have only one line pro imported data file and no more lines?
thank you for the help
andr openoffice 4.6.0 android e win10pro
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Macro for copy datas from more files in another one

Post by Villeroy »

Very easy: Add an export sheet referencing the values you want to export.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
savezin
Posts: 7
Joined: Thu Feb 04, 2021 6:01 pm

Re: Macro for copy datas from more files in another one

Post by savezin »

Villeroy wrote:Very easy: Add an export sheet referencing the values you want to export.
THANK YOU VERY MUCH, IT IS WORK CORRECTLY. :super:
andr openoffice 4.6.0 android e win10pro
Post Reply