The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 copy and past column

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Bigprophete 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.
}
4   L A T E S T    R E P L I E S    (Newest First)
Bigprophete Posted - 03/16/2016 : 06:01:16 AM
It works !
Thank you very much

Mathias
jasonzhao 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
Bigprophete 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 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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000