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
 Setting Cell 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

gkbradshaw

USA
3 Posts

Posted - 04/14/2011 :  12:13:37 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8.1 and Service Release 8.1.88.89
Operating System: Windows XP

I'm very new to Origin and I guess I'm still stuck in my ways of using Excel somewhat. I found this code here that find the x- and y-axis crossings of a line by typing this into the command window:
range r1 = [Book1]Sheet1!col(1);
range r2 = [Book1]Sheet1!col(2);
r2(0)=;
r1(0, r2)=;

This code works great, but I want to set up a template to import data and have the output of this be put into the first cell of two new columns that are otherwise empty. Or if there's a better place to show this data, that's fine. The point is that my Book1 and Sheet1 names can be very long and will always change and I don't want to have to type this in manually every time I import a new data set, that would take forever... Any help on how I can manipulate individual cell values through assignment would be greatly appreciated.

G

greg

USA
1379 Posts

Posted - 04/14/2011 :  3:43:06 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Active elements of a range can be omitted, so if your code executes within the context of the active worksheet of the active workbook, then you can use:
range r1 = col(1);
range r2 = col(2);
col(3)[1] = r2(0);
col(3)[2] = r1(0, r2);
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