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

thentangler

USA
Posts

Posted - 08/15/2010 :  12:09:21 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8.1 and Service Release 3
Operating System: Win 7

Hi,
I need help on accessing worksheets in my scripts.
For example, I have about 50 worksheets in my workbook (Book1) which are named from d1 to d50. And i want to pick out the value in cell(1,30) out from each of the worksheets and put them in a new worksheet so that I will have a column with 50 values in the new worksheet.
How do I do this in Labtalk. What are the syntaxes for accessing and manipulating worksheets in a workbook? I tried searching for it in the help file, but was not very successful. Id really appreciate any help.
thanks

AmandaLu

439 Posts

Posted - 08/16/2010 :  02:46:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear thentangler,

You can define a Range to accessing worksheets. For example, if you want to copy the values in cell(1,30) of every worksheet to a new sheet in Book1, please activate Book1 and run the following scripts:

newsheet;
for(ii=1;ii<=50;ii++)
{
range aa=$(ii)!30;
range bb=51!1;
bb[$(ii)]=aa[1];
}

For more information about Range, please refer to here.
Go to Top of Page

thentangler

USA
Posts

Posted - 08/16/2010 :  11:47:07 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Amanda,
Thank you so much for the reply.
So which is the line which tells it to write to "newsheet"?
is $(ii)! taking the (1,30) value from the iith sheet?
Go to Top of Page

AmandaLu

439 Posts

Posted - 08/17/2010 :  03:16:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:


So which is the line which tells it to write to "newsheet"?



range bb=51!1; //this line define the range bb as the first column in the 51th sheet, which is the new worksheet
bb[$(ii)]=aa[1]; //this line tells it to copy the value in cell(1,30) in the iith sheet to the new worksheet

quote:

is $(ii)! taking the (1,30) value from the iith sheet?



Yes. In this line: range aa=$(ii)!30; we define range aa as the 30th column in the iith sheet.
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