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
 Performing operations on sheets

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
JonasKlim Posted - 10/30/2017 : 06:38:50 AM
How to write a loop to perform operations on all sheets in a workbook except sheet named "Sheet1"?
6   L A T E S T    R E P L I E S    (Newest First)
yuki_wu Posted - 11/02/2017 : 01:55:16 AM
Hi Jonas,

Range is a data type that allows you to access columns, worksheet, matrix or loose dataset. It is just like a general vector, so you can’t assign a string variable to a vector. While aa[1] is considered as an element of the vector, so it works.

Regards,
Yuki
OriginLab
JonasKlim Posted - 11/01/2017 : 10:21:37 AM
Hi Yuki,

Thank you, this way it worked.
Why it did not work when I have defined range range " aa= Sheet1!Col(C)[1]; ", pointing to specific cell?
Regards,

Jonas

quote:
Originally posted by yuki_wu

Hi Jonas,
string str$ = wks.Name$;
range aa = col(A);
aa[1]$ = str$;

http://www.originlab.com/doc/LabTalk/Tutorials/Tutorial-Range-Notation

Hope it helps.

Regards,
Yuki
OriginLab


yuki_wu Posted - 10/31/2017 : 11:30:13 PM
Hi Jonas,
string str$ = wks.Name$;
range aa = col(A);
aa[1]$ = str$;

http://www.originlab.com/doc/LabTalk/Tutorials/Tutorial-Range-Notation

Hope it helps.

Regards,
Yuki
OriginLab
JonasKlim Posted - 10/31/2017 : 08:26:30 AM
Hi,
I want to write name of the sheet to a cell. What shall be corrected in the script below?
//;
string str$= wks.Name$;
str$=;
range aa= Sheet1!Col(C)[1];
aa=str$;
//;
("str$=" prints sheet name, but sheet name is not written in Col(C)[1].)
Please advise.

Jonas
JonasKlim Posted - 10/30/2017 : 08:49:54 AM
Hi Yuki,

int rot=0;
doc -e LW //Loop over all worksheet in the current workbook only;
{
string str$= wks.Name$;
rot=rot+1;
if (str$ != "Sheet1") {rot= ; str$=;}

};
has worked.
Thanks.
Jonas

quote:
Originally posted by yuki_wu

Hi,

I think you may want something like this.

doc -e LW  //Loop over all worksheet in the current workbook only
{
	string str wks.Name$;
        if(str != “Sheet1”)
        {
 	 …
        }
}

Hope it helps.

Regards,
Yuki
OriginLab

yuki_wu Posted - 10/30/2017 : 06:58:23 AM
Hi,

I think you may want something like this.

doc -e LW  //Loop over all worksheet in the current workbook only
{
	string str wks.Name$;
        if(str != “Sheet1”)
        {
 	 …
        }
}

Hope it helps.

Regards,
Yuki
OriginLab

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