Hey I have one book with one sheet in it. in that sheet there is an column with different ID numbers in them. I try to use the "set values" on another column, and would like to use the given ID to acces another sheet with that ID as a name.
My try was something like this:
range cc = [Book2]Sheet1!Col(D1);
string ttt$ = "cc";
range test = [ttt$]ttt$!; NumberOfRows = test.nRows/test.nCols;
double A = 0;
for(ii = 1; ii <= NumberOfRows; ii++) { A = A + ID23017_A[ii]; }
After running the above assignment statement, if you check the value of ttt$ you'd see it holds the string "cc".
If you wanted it to return "[Book2]Sheet1!Col(D1)" then you'd use the following:
string ttt$ = %(cc);
but I think when you say the column has an ID that you mean the ID is the Long Name?
so what you really want is the following:
range cc = [Book2]Sheet1!Col(D1); string ttt$ = cc[L]$;
Also when you use the ID23017_A notation, you could replace that with range notation too. Create a range variable that is the A column in the ID23017 sheet and then use that. For example:
range rr = [SomeBook]ID23017!col(A); A = A + rr[ii];
By the way, replace "A = A + rr[ii];" with "A+=rr[ii];". This shorthand notation will also result in a speedier calculation.
I still get an expression error, with both methods. How do i check what is in the ttt string. I'm programming in the Set values - Before formula scripts window.
ps. Are there a better place to be programming these things?