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 for Programming
 LabTalk Forum
 csetvalue loop
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

RSiertsema

Netherlands
8 Posts

Posted - 07/02/2014 :  10:08:33 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release: 8.5.1 SR2
Operating System: win 7 pro

Hello Originlab!

I am looking for a script that will input numbers from workbook A, sheet 1, column 2 in the 'set column value' of the columns of workbook B. The trouble is that the amount of columns and numbers are variable (though always equal between them), so I need to use a loop.

My try has been the following:

loop(ii, 1, wks.ncols)
{
csetvalue formula:="[workbookA]1!2[$(ii)]*col($(ii))" col:=$(ii) recalculate:=1;
}

Sadly this returns an error. Could you help me with this?

With kind regards,


Reinier

lkb0221

China
497 Posts

Posted - 07/02/2014 :  2:13:48 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Function body of SCV cannot recognize range string. You need to put it in the before formula part.
And you need to use wcol instead of col for index.
For example:

loop(ii, 1, wks.ncols)
{
csetvalue col:=$(ii) formula:="r1[$(ii)]*wcol($(ii))" script:="range r1 = [workbookA]1!2" recalculate:=1;
}

Zheng
OriginLab

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