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
 Loop - Column distribution to new 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

cyantist

USA
8 Posts

Posted - 02/25/2010 :  10:11:09 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 7.5
Operating System: WinXP

Is there a way I can loop the following tasks to automate copying designated columns into pre-created worksheets:
(where main worksheets are WS1 up to WS15, and pre-created worksheets are G01 up to G15)

%(G01,3)=%(WS1,2); // copies data1/col2 to newdata1/col3
%(G01,4)=%(WS1,50); // copies data1/col4 to newdata2/col1
%(G01,5)=%(WS1,18);
%(G01,6)=%(WS1,66);
%(G01,7)=%(WS1,34);
%(G01,8)=%(WS1,82);

window -a G01; // make G01 active window
mark -d G01_1 -b 1 -e 4; // delete first 4 cols in G01


%(G02,3)=%(WS1,3);
%(G02,4)=%(WS1,51);
%(G02,5)=%(WS1,19);
%(G02,6)=%(WS1,67);
%(G02,7)=%(WS1,35);
%(G02,8)=%(WS1,83);

window -a G01; // make G01 active window
mark -d G01_1 -b 1 -e 4; // delete first 4 cols in G01

...and so on, until G15. Then repeat for WS2 (but with different column designations in G), and so on until WS15.

I'm a total noob in automating Origin and programming in general, but I'm learning as I go along. I'll try to post any solutions I find.

Thanks!

Laurie

USA
404 Posts

Posted - 02/26/2010 :  6:08:14 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You could do something like the following:
index1=2;
index2=50;
index3=18;
index4=66;
index5=34;
index6=82;
loop(ii,1,15){
%(G0$(ii),3)=%(WS1,index1);
%(G0$(ii),4)=%(WS1,index2);
%(G0$(ii),5)=%(WS1,index3);
%(G0$(ii),6)=%(WS1,index4);
%(G0$(ii),7)=%(WS1,index5);
%(G0$(ii),8)=%(WS1,index6);
index1++;
index2++;
index3++;
index4++;
index5++;
index6++;
}

OriginLab Technical Support
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