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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Copying Cells to a new worksheet

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Tobias Hagen Posted - 03/29/2019 : 03:14:52 AM
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
2   L A T E S T    R E P L I E S    (Newest First)
Tobias Hagen Posted - 03/29/2019 : 07:35:27 AM
Thank you very much Castiel!
I will try that out as soon as I can. A very nice weekend to you.

Best regards
Tobias
Castiel Posted - 03/29/2019 : 04:33:20 AM
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
**********************************************************

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000