Copy a range of worksheet cells to another range
Minimum Origin Version Required: 8.0 SR5
Please refer to the page for additional option switches when accessing the x-function from script
Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
---|---|---|---|---|
Input Worksheet | iw |
Input Worksheet |
|
Specify the source worksheet. In it, a range of cells, which is defined by c1, c2, r1 and r2 below, will be copied to the destination worksheet. |
Output Worksheet | ow |
Output Worksheet |
|
Specify the destination worksheet.
See the syntax here. |
Source Range Column Begin | c1 |
Input int |
|
Specify the first column in the range to be copied. |
Source Range Column End | c2 |
Input int |
|
Specify the last column in the range to be copied. |
Soruce Range Row Begin | r1 |
Input int |
|
Specify the first row in the range to be copied. |
Source Range Row End | r2 |
Input int |
|
Specify the last row in the range to be copied. |
Source Range Long Name Row | name |
Input int |
|
Specify a row in the source worksheet whose content will be used as long names for columns in the destination worksheet. |
Destination Column Begin | dc1 |
Input int |
|
Specify the first column in the range of the destination worksheet, to which the copied worksheet range will be pasted. |
Destination Row Begin | dr1 |
Input int |
|
Specify the first row in the range of the destination worksheet, to which the copied worksheet range will be pasted. |
Copy Column Labels | label |
Input string |
|
Specify whether to copy the column labels. You can specify which labels will be copied by the column label row characters. For example, LUCP1D1, where L for Long name, U for Unit, C for Comments, P for Parameters and D for User defined parameters. Column label row characters for this X-Function was supported from Origin 8.1 SR3. Two integers, 0 and 1 are also supported for compatibility reason. Where
|
Copy Column Format | format |
Input int |
|
Specify whether to copy the column format. |
Transpose | transpose |
Input int |
|
Specify whether to transpose the copied range. |
Clear Output Columns | clear |
Input int |
|
Clear output columns:
|
This X-Function can be used to copy the range of cells in a worksheet to another. A row in the source worksheet can be used to set the long names of the columns in the destination worksheet.
The following script command is used to copy the cells range from second row to the end of Sheet1 in Book1 to a new worksheet named Copysheet in the same workbook. And it uses the first row of the source worksheet to set the Long Name of the columns in the destination worksheet. It copies the Units and Comments as well.
wrcopy iw:=[Book1]Sheet1! ow:=[Book1]"Copysheet"! r1:=2 name:=1 label:=UC;