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
 Adress worksheets by numbers possible?

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
Clemens604 Posted - 05/25/2022 : 04:47:23 AM
Hi,

I'm completely new to LabTalk therefore please excuse me, if my question is stupid.

I am using the following "before formula script" (in "set values" for a column):

range FCval = [Book1]#1.39_0__14-47-19-730!col(D)

By this I define the range variable FCval as the column D in the worksheet with the name #1.39_0__14-47-19-730.

So far so good, it works as long as the name of the worksheet stays the same. However, I want to use worksheets with many range variables as shown above as templates for other file,s where the worksheets have differing names. Now I have to change all the worksheet names manually which is quite annoying.

Therefore my question is, if I can address the worksheets e.g by their ordering number as I can do it e.g. in VBA for Excel ("sheets(1)")? Or is there another solution?

Thank you in advance and best regards,
Clemens




Origin Ver. and Service Release Origin 2022 (64-bit) SR1
Operating System: Win10
4   L A T E S T    R E P L I E S    (Newest First)
Clemens604 Posted - 05/30/2022 : 07:54:49 AM
Yepp, just "3" works perfectly. Thanks!
cpyang Posted - 05/25/2022 : 11:07:22 AM
You should just stick with 3!, Sheet3 means the sheet name is "Sheet3" which is not your case.

As long as you just rename and not moving the sheet around, that should work.

CP
aplotnikov Posted - 05/25/2022 : 07:04:08 AM
range FCval = [Book1]"Sheet3"!col(D)
Clemens604 Posted - 05/25/2022 : 06:07:59 AM
Ok, I've already found the solution. I could just replace the name of the worksheet by its' index. E.g.:

range FCval = [Book1]#1.39_0__14-47-19-730!col(D)
range FCval = [Book1]3!col(D)

What didn't work was:

range FCval = [Book1]Sheet3!col(D)

Just in case someone has the same problem...

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