DIAdem Help

Method: CopyArea for Sheet

  • Updated2024-09-12
  • 2 minute(s) read

Method: CopyArea for Sheet

Copies an area in DIAdem VIEW and splits the specified target area in the same or another worksheet. Use the Copy for Areas method to copy an area within the same worksheet. Use the MoveArea for Sheet or the Move for Areas method to move an area.

Set oArea = Object.CopyArea(SourceAreaNameOrIndex, TargetSheetNameOrIndex, TargetAreaNameOrIndex, enumSplitDirection, Ratio)
ObjectSheet
Object with this method
SourceAreaNameOrIndexVariant
Specifies the name or index of the area you want to copy.
TargetSheetNameOrIndexVariant
Specifies the name or index of the worksheet to which DIAdem copies the area. If you specify an empty string, DIAdem creates a new worksheet and ignores the subsequent parameters.
TargetAreaNameOrIndexVariant
Specifies the name or index of the target area. If you specify an empty string for TargetSheetNameOrIndex, DIAdem ignores this parameter.
enumSplitDirectionLongInteger

Specifies the relative position of the copied area to the target area.  If you specify an empty string for TargetSheetNameOrIndex, DIAdem ignores this parameter.
1eSplitTopTop
2eSplitBottomBottom
3eSplitLeftLeft
4eSplitRightRight
RatioDouble
Specifies the split ratio for values from 0 to 1. The split ratio is the proportion of original area which the copied area occupies. If the split ratio is 0.25, the copied area takes up a quarter of the original area. If you specify an empty string for TargetSheetNameOrIndex, DIAdem ignores this parameter.
oAreaArea
Returned object of the copied area.

The following example copies the first area of the active worksheet to the right of the first area of a new worksheet. The copied area occupies one quarter of the target area.

VBScriptPython

 

Dim oMySheet, oNewSheet, oMyCopiedArea
Set oMySheet = View.ActiveSheet
Set oNewSheet = View.Sheets.Add("MyNewSheet")
Set oMyCopiedArea = oMySheet.CopyArea(1, oMySheet.Index, 1, eSplitRight, 0.25)

The following example copies the first area of the active worksheet to a new worksheet.

VBScriptPython

 

Dim oMySheet, oMyCopiedArea
Set oMySheet = View.ActiveSheet
Set oMyCopiedArea = oMySheet.CopyArea(1, "", 0, 0, 0)