In your post you state you want to copy both the column name and label along with the data. Do you want to copy the data to another column in the same worksheet or to a column in a different worksheet? Origin names each column of data with a unique dataset name. The dataset name is the worksheet window name and an underscore "_", followed by the column name. An example of this is Data1_B, which refers to the second column in the Origin default worksheet. During data analysis, the dataset name is used as a variable in calculations. This means you cannot have more than one column with the same name within the same worksheet. Since the dataset is a combination of the worksheet window name and the column name, you can have the same column name within different worksheets. To safeguard this, no two Origin windows can have the same name. However, you can have more than one column within the same window/worksheet that have the same column label.
In Origin versions 4 and 5 you can copy an entire worksheet window. This includes the worksheet column names and labels. First click on the worksheet that you want to duplicate to set it as the active window. Next select Window: Duplicate from the Origin Menu Bar. Alternatively, you can click on the Window Duplicate Icon, which is found on the Standard Origin Toolbar. The Win -D LabTalk command can also be used to duplicate the active window. The use of LabTalk is discussed further down the page.
There is no menu item that will copy the data and the column label at the same time. If you want to automate the copying of a column of data along with the label you will have to utilize the Origin LabTalk scripting language. You can run the script from a file or a button. A complete explanation of this is found in the Origin LabTalk manual. This is the only way to copy the data within a column along with the dataset label. For testing LabTalk script, you can cut and paste the following script into the Origin Script Window. Highlight the script and press the "ENTER" key. Before you do this make sure that you have created two worksheets. One should be named Data1 and will contain the data you want to copy along with the worksheet labels. The second worksheet should be called data2 and needs to contain just the default two columns.
What this script will do is as follows:
1. The first line of code will set the data2 worksheet to display column labels.
2. The next line of code will copy the data from column two of the data1 worksheet and place these numbers in the first column of the data2 worksheet.
3. The last line of code will copy the worksheet column label from the second column of the data1worksheet and place the label in the first column of the data2 worksheet.
data2!wks.LABELs(1);
copy data1_B data2_A;
data2!WKS.COL1.LABEL$=data1!WKS.COL2.LABEL$;
Much of the information needed to manipulate data within the worksheet can be found on page 335 of the Origin Version 5 LabTalk manual. This is also available using the on-line LabTalk help file by selecting the HELP INDEX with keyword WKS
[This message has been edited by scottp (edited 02-04-99).]