Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.word.tables
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Search & Replace

The following macro will clear trailing spaces from all the cells in the
table containing the cursor

Dim oRng As Range
With Selection.Tables(1)
For i = 1 To .Rows.Count
For j = 1 To .Columns.Count
Set oRng = .Cell(i, j).Range
oRng.End = oRng.End - 1
oRng.Text = RTrim(oRng.Text)
Next j
Next i
End With

If you want to clear leading and trailing spaces change RTrim for Trim

Note that if you select the table and Click CTRL+E then CTRL+L all leading
and trailing white space will be cleared from the table.

--

Graham Mayor - Word MVP

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




"Johann Swart" wrote in message
...
Hi Graham,
Apologies; I expressed myself incorrectly. I am not referring to paragraph
breaks (¶) in table cell, but to the actual cell marker (¤).
I have several documents that contain tables with a space or spaces
between
the last character and the cell marker that I need to remove (quite
laborious
in a 100-page document riddled with tables).
The ^10 suggested by DeanH does not do it either. I have tried a number of
permutations, and frankly, some weird things happen.

"Graham Mayor" wrote:

Paragraph breaks are paragraph breaks wherever they are in the document.
What *exactly* are you trying to do?

--

Graham Mayor - Word MVP

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



"Johann Swart" wrote in message
...
In Search & Replace (Find & Replace) where paragraph signs are
involved,
one
would use ^p in normal text or ^13 when using wild cards.
What are the equivalent codes when using Search & Replace in tables?



.





 
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 07:27 AM.

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"