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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Easy way to combine multiple worksheets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

smigs

USA
Posts

Posted - 03/30/2005 :  5:15:50 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7SR2
Operating System: Windows XP

Hello all,
I have a file with multiple (125) worksheets and I would like to take column 7 from each worksheet and add it to a new worksheet. Is there and easy way to do this?

Thanks,
Ed

Mike Buess

USA
3037 Posts

Posted - 03/30/2005 :  11:19:15 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Ed,

I assume that you want to add all columns to the same worksheet. If that's the case then here's a simple LabTalk solution...

win -t D; // create target wks
%W=%H; // save its name
repeat wks.ncols {del col(1)}; // delete all columns
ii=0;
doc -e W {
// loop through all worksheets but skip the target (current wks name is %H)
if("%H"!="%W") {
ii++;
if(%W!wks.nrows<wks.nrows) set %W -er wks.nrows; // add more rows to target if necessary
%W!wks.addCol(); // add col to target
%W!wks.col$(ii).label$=%H; // label the col with current wks name
%(%W,ii)=%(%H,7); // copy col 7 of current wks to new col
};
};
%W!wks.labels(); // show column labels

Mike Buess
Origin WebRing Member
Go to Top of Page

nixel

France
1 Posts

Posted - 11/08/2016 :  3:34:12 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

I have a similar task, except that it concerns rows, but I don't know what I should change in the code:
I need to copy 7th row from Sheet1 of range Book1-Book22 to a new workbook.
To each appended row i want to add a cell (in a new column) that would contain first three letters of old workbook long name.

Thanks a lot for your help!
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000