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
 How to add a column only to specified sheets?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Noname123

Armenia
16 Posts

Posted - 03/31/2022 :  03:40:23 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I'd like to add a column that is a function of another column, but only to specified worksheets in specified workbooks. Here is the code:
doc -ef W {
doc -e LW { (if(%H == "J10aX" || %H == "J11aX" || %H == "J12aX" 
|| %H == "J13aX"  ||  %H == "J14aX" ||  %H == "J15aX" ||  %H == "J16aX" || %H == "J17aX"
|| %H == "J18aX");

{ if(wks.name$=="mixed"){
// Add a column
wks.addcol();
// get index of added column
int ncols = wks.ncols;
// set value of this new col
wcol(ncols) = Col(D) * 0.005}}
}};


This code doesn't work. Can someone point out my mistake?
  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