Hi,
The problem occurs because in range notation, the variable "end" is by default to indicate the last row of the column. So I suggest that instead of using "end" as the variable name, you could choose other variable names. For example, I modified your script as follow and only change "Start" into "i" and "End" into "j", this shall work fine.(Origin version 8.6 SR2)
//create data
range r1 = [Book1]Sheet1!wcol(1);
r1 = data(1,6);
for (ii=1; ii<=4; ii++)
{
range r2 = [Book1]Sheet1!wcol(ii);
r2=r1*ii;
}
//This loop is now working
range OriData = [Book1]Sheet1!;
int i = 1;
int j = 0;
int ColN=OriData.ncols;
for (ii=1; ii<=ColN; ii++)
{
range r1 = [Book1]Sheet1!wcol(ii);
i = ;
j = i + r1.getsize()-1;
j =;
range r2 = [Book1]Sheet1!wcol(ColN+1)[i:j];
r2 = r1;
i = j+1;
}
Kathy
Originlab