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
 Origin Forum
 Worksheet to define variables ?

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
Xeal Posted - 09/29/2011 : 05:29:02 AM
Hello,

I'd like to build a worksheet, in which I define values for different cells, e.g. A1 = 5.

How can I use this value in a different worksheet to calculate other cell values with the "set values" dialog ?

Regards
Holger
8   L A T E S T    R E P L I E S    (Newest First)
CaitPes81 Posted - 10/12/2011 : 12:29:20 AM
Have the same problem. This thread definitely helped me.

Caitlin Pescott
Hideo Fujii Posted - 10/06/2011 : 09:48:53 AM
Hi Holger

> no ideas?

As in any computer language, in general once you assign some value to a variable, the variable's content wouldn't be updated until the assignment is executed next time. But, if your assignment of the variable in the "Before Formula Script" box in Set Values dialog, and Recalculation mode was set to "Auto", every time when the recalculation is kicked in, the assignment command will be also executed before the execution of the main body.

--Hideo Fujii
OriginLab
Xeal Posted - 10/05/2011 : 12:13:53 PM
quote:
Originally posted by Xeal

Ok, next Problem:
Everything works fine, but if I change the Parameters in my worksheet, the values I comupte don't update automatically. I assume, that the range variables have to be updated, after I changed the values of my parameters. How can I realize that ?

Regards
Holger




no ideas?
Xeal Posted - 10/04/2011 : 11:15:35 AM
Ok, next Problem:
Everything works fine, but if I change the Parameters in my worksheet, the values I comupte don't update automatically. I assume, that the range variables have to be updated, after I changed the values of my parameters. How can I realize that ?

Regards
Holger
Xeal Posted - 10/02/2011 : 06:36:38 AM
quote:
Originally posted by Hideo Fujii

Hi Holger,

There seems two issues:

1) In range r2=[Book1]Sheet1!C"magnification"[1] , it seems you specified both the short name and the long name of the column. This is not "incorrect", but redundant and error prone. So, if you have the short name, r2=[Book1]Sheet1!col(C)[1] is sufficient.

2) If you wan to control the referred cell by a row number, you can define a range of the column, then you can refer a cell by indexing the range variable such that:
  r2=[Book1]Sheet1!col(C);
  ii=2;  //row number of the parameter
  myParameter = r2[ii];

Do these above suggestions make sense and work?

--Hideo Fujii
OriginLab




Hi,

Thanks for your answer. I don't understand why it works, but it works :)

Regards
Holger
Hideo Fujii Posted - 09/30/2011 : 3:03:27 PM
Hi Holger,

There seems two issues:

1) In range r2=[Book1]Sheet1!C"magnification"[1] , it seems you specified both the short name and the long name of the column. This is not "incorrect", but redundant and error prone. So, if you have the short name, r2=[Book1]Sheet1!col(C)[1] is sufficient.

2) If you wan to control the referred cell by a row number, you can define a range of the column, then you can refer a cell by indexing the range variable such that:
  r2=[Book1]Sheet1!col(C);
  ii=2;  //row number of the parameter
  myParameter = r2[ii];

Do these above suggestions make sense and work?

--Hideo Fujii
OriginLab
Xeal Posted - 09/30/2011 : 04:49:14 AM
Thanks for your quick answer.
I tried your suggestion like this:
I have a worksheet with the parameters I need for my calculations (three numbers). Each parameter is in the first line of this worksheet.

In the worksheet with my calculations, I defined three range variables (like: range r2 = [Book1]Sheet1!C"magnification"[1];) and use them in the set values column.

The Problem is: Origin does the calculation only in the first row of the column with my calculations.

If I define the range variable like this: range r2 = [Book1]Sheet1!C"magnification";

and write down the parameter in all the rows it works. But I'd like to write down the parameters only in the first row (one time) and then calculate with this parameter in all other rows from an other worksheet.

Regards
Holger
vincenth Posted - 09/29/2011 : 11:37:14 AM
You can address a particular cell directly, while in the same sheet, as in:

col(a)[1]

or assign a range variable to it, which is better if you're going between sheets:

range aa = [Book1]Sheet1!col(a)[1];
range bb = [Book2]Sheet1!col(b)[7];
bb = aa;

If using Set Column Values, define the ranges in the Before Formula Scripts section.

Regards,
Vince

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