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
 Simple calculation...
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

cengelhard

Germany
Posts

Posted - 06/21/2005 :  01:30:48 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5 SR5
Operating System: WinXP SP2

I am sorry, I am pretty new to Origin. I searched the forum, but maybe my question is to simple:

I have two worksheets (WS1, WS2) with 500 columns, 80 rows.
I would like to create a third worksheet WS3 with data in each column multiplied like this: WS1_column1 * WS2_column1
How could it be done automatically (loop..) without "set values.." manually?

Thanks for any reply,
Carsten

Leo_Li

China
Posts

Posted - 06/21/2005 :  06:55:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Assume names of your source worksheets: Data1, Data2; and destination: Data3. Paste the following codes to the script window.
Select the three lines of code and press Enter.

for (j = 1; j <= wks.nCols; j++)
for (i = 1; i <= wks.nRows; i++)
Data3!cell(i,j)=Data1!cell(i,j)*Data2!cell(i,j);
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