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
 Copy multiple columns
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

SMOrigin

2 Posts

Posted - 03/07/2014 :  09:41:23 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
How can one copy every 8th column from multiple worksheets into single worksheet. For example, I have 200 worksheets named Dft(1), Dft(2)......... and I want to copy every 8th column named as S1 from the 200 worksheets into a new worksheet.

zahraa

USA
52 Posts

Posted - 03/07/2014 :  4:59:05 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear S M,

You can try the following script in Script Window:

doc -e LB {colcopy irng:=col(8) orng:=[Book2]Sheet201!Col(nn) data:=1 lname:=1 units:=1 comments:=1 para:=1;
}


Please put in the name of the workbook all your worksheets are in where it says Book2 in the script. Once it has finished running, a dialog will appear asking you to specify the destination columns but you can just close that. This should input the data in every 8th column into a newly created worksheet 201 in your present workbook along with the Long Name Units, Comments and Parameters of the eighth columns.
Hope this helps
Go to Top of Page

SMOrigin

2 Posts

Posted - 03/08/2014 :  02:38:25 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It works, although it inserts a space after every column. But it can be sorted out in excel afterwards. Thanks a ton, Zahraa.
Go to Top of Page

miheico

2 Posts

Posted - 04/19/2014 :  4:35:09 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi!
I have a similar question. For example: I have a 2000 workbooks named AQ1 and up to AQ2000 and just with one worksheet. And I need to copy each 7-th column from all 2000 workbooks to the new workbook. How can I do that?

Thanks a lot!!
Go to Top of Page

lkb0221

China
497 Posts

Posted - 04/21/2014 :  5:19:12 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

First, prepare a new workbook to place those 7th columns. In the following example script, "Result" is the target workbook.
//Script Start
loop(ii,1,2000) // loop form 1 to 2000
{
range r1 = [AQ$(ii)]1!7; // point to the (ii)th wks.
range r2 = [Result]1!$(ii); // point to the (ii)th column in the result wks.
colcopy irng:=r1 orng:=r2; // Copy this column over.
}
//Script End

Zheng
OriginLab

Edited by - lkb0221 on 04/21/2014 5:20:47 PM
Go to Top of Page

miheico

2 Posts

Posted - 04/22/2014 :  04:55:37 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you, lkb0221. But I have a problem. My numeration of workbooks isn't fitting to the script. They are numerated from AQ0001 and up to AQ2000.
The script can't catch names.

I found how to do that. I just used specifier like: [AQ$(ii, #4)]1!7. Now it works very nice.
Thanks a lot!

Edited by - miheico on 04/22/2014 06:15:29 AM
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