Hi, WG.
Since I am not clear about what the 'acceptable range' is, I am afraid that I cannot provide a complete solution.
I guess you have 21 columns in your worksheet with the first set as X and the rest Y. Then your macro should loop over the Y columns to check if any value in the column are out of the range. If so, the column should be deleted.
Suppose you want all the y values to be not less than 10 and not greater than 30. Then the following code will do the trick.
UpperBound=30;
LowerBound=10;
for (ii=21; ii>=2; ii--)
{
bDelCol = 0;
for (jj=1; jj<=wks.nRows; jj++)
{
if ((col($(ii))[$(jj)]>UpperBound)||(col($(ii))[$(jj)]<LowerBound))
{
bDelCol = 1;
break;
}
}
if (bDelCol==1) del col($(ii));
}
Please change the expression in the parentheses after 'if' to tell Origin what kind of values are out of the acceptable range. I hope this will help
Deanna
OriginLab GZ Office
Edited by - Deanna on 04/17/2006 02:41:41 AM
Edited by - Deanna on 04/17/2006 02:43:40 AM