Author |
Topic  |
|
Bigprophete
France
20 Posts |
Posted - 03/16/2016 : 01:49:15 AM
|
Hello, I have a small problem. I have a lot of workbook (eg. 10, 20 or 30). I want to copy the column 7 of each worbook and past in a new workbook called results (for example). I have the following problem, it create the workbook result with only the value of the first workbook...
doc -ef W { range r1 = [%H]1!7; // point to the 7eme column of the active workbook range r2 = [Result]1!; colcopy irng:=r1 orng:=r2; // Copy this column over. } |
|
jasonzhao
China
262 Posts |
Posted - 03/16/2016 : 04:50:25 AM
|
Hello,
Please try the code in this way:
// i=1; doc -ef W { range r1 = [%H]1!7; // point to the column of the active workbook range r2 = [Result]1!col($(i)); r2=r1; i++; }
Best regards! Jason OriginLab Technical Service |
Edited by - jasonzhao on 03/16/2016 04:51:37 AM |
 |
|
Bigprophete
France
20 Posts |
Posted - 03/16/2016 : 05:08:14 AM
|
Thanks, It works but I still have a small problem, for example if I have 5 workbooks, it returns 6 values. For example the value of the workbook 4 is copied two times, then, if I delete the workbook "result" and run the code again, the value added corresponds to the workbook 5 (the increment is +1...)
Mathias |
 |
|
jasonzhao
China
262 Posts |
Posted - 03/16/2016 : 05:45:34 AM
|
Hello,
You can exclude the workbook Result in the loop;
i=1; doc -ef W { if (%H=="Result") continue; range r1 = [%H]1!3; // point to the 7eme column of the active workbook range r2 = [Result]1!col($(i)); r2=r1; i++; }
Best regards! Jason OriginLab Technical Service |
Edited by - jasonzhao on 03/16/2016 05:46:44 AM |
 |
|
Bigprophete
France
20 Posts |
Posted - 03/16/2016 : 06:01:16 AM
|
It works ! Thank you very much
Mathias |
 |
|
|
Topic  |
|