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
 Copying specific columns from multiple worksheets

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
Clairepibro Posted - 08/09/2017 : 5:38:37 PM
Origin Ver. and Service Release (Select Help-->About Origin):
Operating System:

Hello,

I am a very beginner using Labtalk within origin.
I seem to be running into syntax issues.

I have workbook with 100-500 worksheets.

I would like to copy the 2nd column from each worksheet to a new worksheet ( or book), such that they are consolidated in the right order to 1 sheet.

Thank you in advance for your help!!!

new user
2   L A T E S T    R E P L I E S    (Newest First)
Clairepibro Posted - 08/10/2017 : 11:28:37 AM
Hi,

Thanks very much for your help Yuki that worked perfectly!

yuki_wu Posted - 08/10/2017 : 01:58:58 AM
Hi,

Let’s take an example. It is supposed that we have a workbook named Book1, and now we copy the second column in every sheet of Book1 to Book2:


win -a "Book1"; //Activate workbook, Book1
// Loop over all worksheets in Book1
loop(ii,1,page.nlayers)
{
	range rW = [Book1]$(ii)!col(2);
	// Copy the second column in the current worksheet to [Book2]Sheet1!
	colcopy irng:=rW orng:=[Book2]Sheet1!col($(ii));
}


For the detailed explanation of the associated syntax, please refer to these help file pages:
http://www.originlab.com/doc/X-Function/ref/colcopy
http://www.originlab.com/doc/LabTalk/ref/Loop-cmd
http://www.originlab.com/doc/LabTalk/guide/Looping-Over-objs

Hope it helps.

Regards,
Yuki
OriginLab

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