Hi AliceInNanoland and visitors to this thread,
This is an addendum to my previous post. Although probably it doesn't matter in this specific situation for
the unstacked result, if the column contains missing values at the end of the dataset, rr.getSize() would return
the inflated value. To avoid such case, and to get the "actual" dataset size, you may want to define a function
like:function double getActualSize(range ra) {
int icnt, irow=ra.getSize();
for(icnt=irow; icnt>=1; icnt--) if(ra[icnt]$!="" && ra[icnt]$!="--") break;
return icnt;
}
Then, the code could be written like: colthresh=3; //threshold
nc=wks.nCols;
for(ii=nc; ii>=1; ii--) {
range rr=wcol(ii);
if(getActualSize(rr)<=colthresh) del wcol(ii); //delete if shorter than threshold
}
Hope this suggestion helps in some situations.
--Hideo Fujii
OriginLab