Origin Version (Select Help-->About Origin): 7SR2 Operating System: Windows XP
Hello all, I have a file with multiple (125) worksheets and I would like to take column 7 from each worksheet and add it to a new worksheet. Is there and easy way to do this?
I assume that you want to add all columns to the same worksheet. If that's the case then here's a simple LabTalk solution...
win -t D; // create target wks %W=%H; // save its name repeat wks.ncols {del col(1)}; // delete all columns ii=0; doc -e W { // loop through all worksheets but skip the target (current wks name is %H) if("%H"!="%W") { ii++; if(%W!wks.nrows<wks.nrows) set %W -er wks.nrows; // add more rows to target if necessary %W!wks.addCol(); // add col to target %W!wks.col$(ii).label$=%H; // label the col with current wks name %(%W,ii)=%(%H,7); // copy col 7 of current wks to new col }; }; %W!wks.labels(); // show column labels
I have a similar task, except that it concerns rows, but I don't know what I should change in the code: I need to copy 7th row from Sheet1 of range Book1-Book22 to a new workbook. To each appended row i want to add a cell (in a new column) that would contain first three letters of old workbook long name.