View Single Post
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default macro to merge two table cells?

Sub MergeCellToRight()
Dim oRng As Range
Dim oCell As Cell
Dim i As Long
Set oCell = Selection.Cells(1)
If oCell.ColumnIndex = Selection.Rows(1).Cells.Count Then
MsgBox "There is no cell to the right?", vbCritical, "Error"
Exit Sub
End If
Set oRng = oCell.Range
oRng.MoveEnd wdCell, 1
oRng.Cells.Merge
oCell.Select
Selection.Collapse wdCollapseStart
End Sub


will merge the cell containing the cursor with the cell to the right

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



"David Newmarch" wrote in message
news
I've trying unsuccessfully to record a macro that will merge a table cell
with the cell to the right of it. Could anyone suggest code that would do
this?