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

pink-lisa

UK
Posts

Posted - 12/11/2006 :  07:27:12 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version 7

Hi,

I have 30 columns of data and I want to divide alternate columns by 3. I can do it using "set column values" and doing each column individually. However I need to do this for a lot of data. Is there a way I can do this in a worksheet in one go?

Mike Buess

USA
3037 Posts

Posted - 12/11/2006 :  08:07:26 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Enter one of these commands in the script window...

loop(i,1,wks.ncols) {if( mod(i,2)==1 ) wcol(i)/=3}; // divide cols 1, 3, 5, etc.

loop(i,1,wks.ncols) {if( mod(i,2)==0 ) wcol(i)/=3}; // divide cols 2, 4, 6, etc.

Mike Buess
Origin WebRing Member
Go to Top of Page

pink-lisa

UK
Posts

Posted - 12/12/2006 :  11:12:53 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
That works. Thank you so much, Mike. I have never used the script thing before, Cheers.
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