Home |
Search |
Today's Posts |
#12
Posted to microsoft.public.word.tables
|
|||
|
|||
Search & Replace
"Graham Mayor" wrote: Good thinking - that would equate to Dim oRng As Range Dim oTable As Table Dim acell As Cell For Each oTable In ActiveDocument.Tables With oTable For Each acell In oTable.Range.Cells Set oRng = acell.Range oRng.End = oRng.End - 1 oRng.Text = RTrim(oRng.Text) Next acell End With Next oTable -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Might be best to first check whether there is actually a space before the end of cell marker to avoid unnecessary trimming. Sub RemSpaceBeforeCellMarker() Dim oRng As Range Dim oTable As Table Dim acell As Cell For Each oTable In ActiveDocument.Tables With oTable For Each acell In oTable.Range.Cells Set oRng = acell.Range oRng.End = oRng.End - 1 If Right(oRng.Text, 1) = " " Then oRng.Text = RTrim(oRng.Text) End If Next acell End With Next oTable End Sub |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Selective Replace in Search and Replace | Microsoft Word Help | |||
Search and Insert, Search and Replace, Modify Document Margins | Formatting Long Documents | |||
Search and replace. | Microsoft Word Help | |||
Search and Replace | Microsoft Word Help | |||
Search and Replace | Formatting Long Documents |