Why am I getting an error when I move g below k? Shouldn't global variables work where ever they are used?
-->
so, this seems to work ... ... So is it not possible to have global variables inside global variables? if so, why did the first set of calcs work?
Thank you in advance
Solved! Go to Solution.
When a worksheet is evaluated it is read twice. In the first scan global assignments are collected, the second run deals with the rest.
So for global definitions the same rules apply as for normal ones. The sheet is read left to right, top down. So when the global(!) definition of h makes use of the globally(!) defined constant f, then f has to be defined in front or to the left of the definition of h.
BTW, it has proven a good advice over the years to use global definition with great care and as sparingly as possible.
When a worksheet is evaluated it is read twice. In the first scan global assignments are collected, the second run deals with the rest.
So for global definitions the same rules apply as for normal ones. The sheet is read left to right, top down. So when the global(!) definition of h makes use of the globally(!) defined constant f, then f has to be defined in front or to the left of the definition of h.
BTW, it has proven a good advice over the years to use global definition with great care and as sparingly as possible.