Merge Method

Microsoft Excel Visual Basic

Merges the scenarios from another sheet into the Scenarios collection.

expression.Merge(Source)

expression    Required. An expression that returns the Scenarios object.

Source   Required Variant. The name of the sheet that contains scenarios to be merged, or a Worksheet object that represents that sheet.

ShowMerge method as it applies to the Styles object.

Merges the styles from another workbook into the Styles collection.

expression.Merge(Workbook)

expression    Required. An expression that returns the Styles object.

Workbook   Required Variant. A Workbook object that represents the workbook containing styles to be merged.

ShowMerge method as it applies to the Range object.

Creates a merged cell from the specified Range object.

expression.Merge(Across)

expression    Required. An expression that returns the Range object.

Across   Optional Variant. True to merge cells in each row of the specified range as separate merged cells. The default value is False.

Remarks

The value of a merged range is specified in the cell of the range's upper-left corner.

Example

This example merges the styles from the workbook Template.xls into the active workbook.

ActiveWorkbook.Styles.Merge Workbook:=Workbooks("TEMPLATE.XLS")