Cell.Merge method (Word)
Merges the specified table cell with another table cell. The result is a single table cell.
Syntax
expression.Merge (MergeTo)
expression Required. A variable that represents a 'Cell' object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
MergeTo | Required | Cell object | The cell to be merged with. |
Example
This example merges the first two cells in table one in the active document with one another and then removes the table borders.
If ActiveDocument.Tables.Count >= 1 Then
With ActiveDocument.Tables(1)
.Cell(Row:=1, Column:=1).Merge _
MergeTo:=.Cell(Row:=1, Column:=2)
.Borders.Enable = False
End With
End If
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for