This code by Meili solved the issue for( ii = 1 ; ii <= wks.ncols-1; ii+=2) {worksheet -s ii 0 ii+1 0; colswap; }
meili_yang
Posted - 02/26/2015 : 1:19:10 PM Hi,
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
Meili
Meili OriginLab Tech Support
Hideo Fujii
Posted - 02/26/2015 : 1:12:52 PM Hi Biotec12,
This should work:
for (ii = 1; ii < 326; ii=ii+2)
{colswap (%(ii), %(ii+1)); }
%(...) is needed to let the LabTalk interpreter resolve the variable as the argument in the command.