Page 1 of 1

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

PostPosted: Sun Feb 07, 2021 5:43 pm
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

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

PostPosted: Sun Feb 21, 2021 4:29 pm
by Bidouille
You must use DataArray property to do this.
Try a search with "insert from sheet", you will find some examples.

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

PostPosted: Sun Feb 21, 2021 5:09 pm
by Villeroy
Configurable solution for all types of spreadsheets and csv: Merge sheets of spreadsheet documents

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

PostPosted: Sat Feb 27, 2021 5:29 pm
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

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

PostPosted: Sat Feb 27, 2021 5:44 pm
by Villeroy
Very easy: Add an export sheet referencing the values you want to export.

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

PostPosted: Sat Feb 27, 2021 6:08 pm
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: