View Single Post
  #1   Report Post  
Posted to microsoft.public.word.tables
Al Al is offline
external usenet poster
 
Posts: 57
Default Insert Paragraph Mark in all Table Cells

I need to have a macro that can insert a Paragraph Mark at the end of every
cell in a table.

I am trying to code this myself from examples but am having no luck

This code offers some hope - I found it from the WordTips site - cycles
through all selected cells but replaces the contents of every cell with
what's in the clipboard, I want to append a Paragraph Mark at the end of the
cell contents.

Sub PasteToCells()
Dim TargetRange As Range
Dim oTargCell As Cell

If Selection.Cells.Count = 0 Then
'Quit if no cells in selection
MsgBox "No cells selected", vbCritical
Exit Sub
End If
On Error Resume Next
Set TargetRange = Selection.Range
For Each oTargCell In Selection.Cells
oTargCell.Range.Paste
Next oTargCell
TargetRange.Select
End Sub

Thank-you
Al