Hi,
Perhaps it is easier to directly assign the value in r3(0) to a worksheet cell (row i and column j) within each loop using col(j)[i] = r3(0), so could be something like:
//First define a range variable as a column in the "new book"
range rr = [Book1]Sheet1!col(1); //Change book/sheet name or column index if needed
//Define an integer as a counter for loops
i = 1;
doc -e W { // loop over all sheets in all books
%H=;
if (%H != "Book1") { // omit the VTH book, which will gather all the y-intercepts
page.active$ = "FitLinearCurve1"; // set the -5 V linear fit table to be active, the default name is usually "FitLinearCurve1"
range r1 = !col(1); // x-values of the linear fit in active worksheet
range r2 = !col(2); // y-values of the linear fit in active worksheet
range r3 = (r2, r1);
r3(0)=; // interpolated y-intercept of the linear fit to the original data
rr[i] = r3(0);//Assign interpolated value to a corresponding cell
i = i + 1;
}
else break;
}
Kathy
Originlab