Maybe try this to swap between every two columns: for( ii = 1 ; ii <= wks.ncols-1; ii+=2) {worksheet -s ii 0 ii+1 0; colswap; }
And this to change for example all x columns to y. for( ii = 1 ; ii <= wks.ncols ; ii+=0) {if (wks.col$(ii).type == 4) wks.col$(ii).type = 1; else ii+1; } Column type: 1 = Y, 2 = disregard, 3 = Y Error, 4 = X, 5 = Label, 6 = Z, and 7 = X Error