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
 Copying Cells to a new worksheet
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Tobias Hagen

Germany
5 Posts

Posted - 03/29/2019 :  03:14:52 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): b9.5.0.193
Operating System: Win 10 64bit

Good morning,
my name is Tobias. For getting an automatic report of my tensile tests, I am using a labtalk script which gets me yield strengths and young's modulus of several tested specimens (new worksheets).

Now I want the both values of young's modulus and yield strength to be gathered along with the name of the specimens in a window.
This means i want to copy the name of the specimen which is in cell B5 to be copied to a new book/sheet cell A1, then the yield strength which is in cell J16 to that new book/sheet cell B1, then the young's modulus which is in J18 to the new book/sheet cell C1. Afterwards it shall continue to do that same procedure for a new specimen which is located in the next worksheet with its data for young's modulus, yield strength and specimen name in the same cells: B5, J16, J18 - but copied to the book/sheet in cells D1, E1, F1.

Could you please tell me how this can be done? I tried a for-loop with those:

//Copy String to different book/worksheet:
[Book2]Sheet1!col(A)[1]$=[Book1]1!col(B)[5]$;

//Copy numeric to different book/worksheet
copydata irng:=[Book1]1!col(J)[16] orng:=[Book2]Sheet1!col(B)[1];

That basically works, but I cannot access the col(XXX)[YYY] with the for-loop variable ii.


Best regards
Tobias

Edited by - Tobias Hagen on 03/29/2019 04:06:35 AM

Castiel

343 Posts

Posted - 03/29/2019 :  04:33:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by Tobias Hagen


Could you please tell me how this can be done? I tried a for-loop with those:

//Copy String to different book/worksheet:
[Book2]Sheet1!col(A)[1]$=[Book1]1!col(B)[5]$;

//Copy numeric to different book/worksheet
copydata irng:=[Book1]1!col(J)[16] orng:=[Book2]Sheet1!col(B)[1];

That basically works, but I cannot access the col(XXX)[YYY] with the for-loop variable ii.




You just ran into one of the most difficult part of LabTalk!

The following script would NOT work:
for(int ii = 1; ii <= 5; ii++)
{
    [Book1]Sheet1!col(ii)[ii]$=;
}


To make it work, change it as one of the followings:
1)
[Book1]Sheet1!col(%(ii))[ii]$=;

2)
[Book1]Sheet1!col($(ii))[ii]$=;

3)
[Book1]Sheet1!wcol(ii)[ii]$=;



                                          &&&&&&&&&
                                        &&&
                                       &&
                                      &  _____ ___________
                                     II__|[] | |   I I   |
                                    |        |_|_  I I  _|
                                   < OO----OOO   OO---OO
**********************************************************
Go to Top of Page

Tobias Hagen

Germany
5 Posts

Posted - 03/29/2019 :  07:35:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you very much Castiel!
I will try that out as soon as I can. A very nice weekend to you.

Best regards
Tobias

Edited by - Tobias Hagen on 03/29/2019 07:59:24 AM
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