Hello,
I want to copy a column named "Mean" in each workbook to a new workbook. Each workbook has one sheet. I tried to use the code below, but it always copies all columns in every workbook to the new workbook. I tried to add an else, break; but it's still the same. Any suggestion would be appreciated.
Here is the code I used:
newbook name:=Collected1;
tcol = 1;
doc -e W
{
if(page.longname$ != "Collected1")
{
loop(ii,1,page.nlayers)
{
page.active = ii;
loop(iii,1,wks.nCols)
{
range rr = wks.col$(iii)
if (rr.name$ = "Mean")
{
colforcopy = iii;
wrcopy
ow:=[Collected1]Sheet1!
c1:=colforcopy
c2:=colforcopy
dc1:=tcol
label:=1
format:=1;
tcol++;
}
}
}
}
}