Hi,
I think you could make use of the colcopy x function to copy your data from other worksheets to be in one worksheet.
You may refer to the following online help file for more information of this XF:
http://www.originlab.com/www/helponline/Origin/en/Programming/mergedProjects/X-Function/X-Function/Colcopy.html
In order to make it simpler, you may use a flow control to loop over the worksheets, here is an example for you to try:
//Book1 is the workbook contains all your worksheets
win -a Book1;
//get the number of worksheets as m, and the number of columns in each worksheet as n
int m=page.nLayers+1;
int n=wks.ncols;
//Create a new book(Book2 in this case) to store the
newbook;
for(int i=1; i<m; i++)
{
win -a Book1;
page.active = i;
int j = n*i - n + 1;
colcopy irng:=1:$(n) orng:=[Book2]Sheet1!$(j):$(j+n-1) format:=1 lname:=1 units:=1 comments:=1 ;
}
In addition, if you only need to copy the data but not the format and column header, you may also use wks.copy and wks.paste, an example would be:
win -a Book1;
int m = page.nLayers + 1;
int n = wks.ncols;
newbook;
for(int i=1; i<m; i++)
{
win -a Book1;
page.active = i;
wks.copy(Z);
win -a Book2;
int j = n*i - n + 1;
wks.paste(Z,j,1);
}
Kathy
Originlab