Hi,
You can use the string variable to change the input and/or output destinations. Please pay attention to the substitution notation. For example:
a=5;
b=85;
c=1;
d=1;
// define string variables for input/output
string bookSource;
string sheetSource;
string bookDestination;
string sheetDestination;
bookSource$ = "book1";
sheetSource$ = "sheet1";
bookDestination$ = "book1";
sheetDestination$ = "sheet2";
loop(ii,1,10)
{
wrcopy iw:=[bookSource$]sheetSource$! c1:=2 r1:=a r2:=b ow:=[bookDestination$]sheetDestination$! dc:=c dr:=d;
a=a+80;
b=b+80;
c=c+1;
// here just change the output to different sheet
sheetDestination$ = "sheet$(ii+2)"; // $(ii+2), $() substitution
}
You can use the same way in copydata command.
string strInput;
string strOutput;
strInput$ = [book1]sheet1!col(1);
strOutput$ = [book1]sheet3!col(1);
loop(ii, 1, 5)
{
copydata irng:=strInput$ orng:=strOutput$;
strInput$ = [book1]sheet1!col($(ii+1));
strOutput$ = [book1]sheet3!col($(ii+1));
}
Penn