Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #12   Report Post  
Posted to microsoft.public.word.tables
David Turner David Turner is offline
external usenet poster
 
Posts: 1
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Selective Replace in Search and Replace msnyc07 Microsoft Word Help 3 December 24th 09 06:58 PM
Search and Insert, Search and Replace, Modify Document Margins instant000 Formatting Long Documents 2 October 26th 09 09:34 PM
Search and replace. tivaelydoc Microsoft Word Help 2 December 22nd 08 01:42 AM
Search and Replace Johann Swart Microsoft Word Help 4 September 25th 06 07:53 AM
Search and Replace Jackie Formatting Long Documents 0 October 20th 05 10:23 AM


All times are GMT +1. The time now is 12:13 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"