expression.Merge(Across)
expression An expression that returns a Range object. This method fails if the range only partially encloses a previously merged cell.
Across Optional Variant. True to merge cells in each row in the specified range as separate merged cells. The default value is False.
Example
This example creates a merged cell from the range B2:C5 and puts a thick red border around the merged cell.
Sub Merge_Cells()
Dim ssConstants
Dim rngMerged
Set ssConstants = Spreadsheet1.Constants
' Merge cells B2:C5.
Spreadsheet1.ActiveSheet.Range("B2:C5").Merge
' Set a variable to the merged range.
Set rngMerged = Spreadsheet1.ActiveSheet.Range("B2").MergeArea
' Format the merged cell.
rngMerged.Borders.Color = "Red"
rngMerged.Borders.Weight = ssConstants.owcLineWeightThick
rngMerged.HorizontalAlignment = ssConstants.xlHAlignCenter
rngMerged.VerticalAlignment = ssConstants.xlVAlignCenter
End Sub