That would also remove paragraph marks elsewhere in the cell apart from at
the end (running multiple paragraphs together). As, indeed, would Doug's
proposal. Helmut's suggestion is closer to the mark but will fail if there
are any empty cells in any table.
This change to Helmut's code will, I believe, work as requested:
Sub Test001()
Dim oTbl As Table
Dim oCll As Cell
For Each oTbl In ActiveDocument.Tables
For Each oCll In oTbl.Range.Cells
Do While oCll.Range.Characters.Count > 1
If oCll.Range.Characters.Last.Previous = Chr(13) Then
oCll.Range.Characters.Last.Previous = ""
Else
Exit Do
End If
Loop
Next
Next
End Sub
--
Enjoy,
Tony
www.WordArticles.com
macropod said:
Hi avkokin,
Here's another approach:
Sub TablesRemovePilcrows()
Dim oTab As Table
For Each oTab In ActiveDocument.Tables
With oTab.Range.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "^p"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute Replace:=wdReplaceAll
End With
Next oTab
End Sub
--
Cheers
macropod
[MVP - Microsoft Word]
avkokin said:
Hello.
There is many tables into doument. Some calls of these tables has
pilcrons (to end of text into cell). I need to remove it. How? I
started it so:
Sub TablesRemovePilcrows()
Dim oTab As Table
For Each oTab In ActiveDocument.Tables
??????
Next oTab
End Sub
Thank you.