Copy Method

Applies To

Section object.

Description

Copies the specified section to another location in the binder, and returns the copy as a Section object. The new copy will automatically be given the name of the original section, with a number in parentheses appended; the original section won't be moved or altered.

Syntax

expression.Copy(Before, After)

expression Required. An expression that returns a Section object.

Before Optional Variant. The name or number of the section that the object will be copied before. You cannot specify Before if you've specified After.

After Optional Variant. The name or number of the section that the object will be copied after. You cannot specify After if you've specified Before.

Example

This example determines whether the second section in Binder1.obd is a Microsoft Excel worksheet. If so, it will be copied after the section named "Totals."

Set myBinder = GetObject("C:\Binder1.obd", "OfficeBinder.Binder")
myBinder.Sections(2).Activate
With myBinder.ActiveSection
If .Type = "Excel.Sheet.8" Then
    .Copy After:="Totals"
End If
End With