A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Search & Replace



 
 
Thread Tools Display Modes
  #1  
Old January 3rd, 2010, 08:09 AM posted to microsoft.public.word.tables
Johann Swart
external usenet poster
 
Posts: 41
Default Search & Replace

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?
  #2  
Old January 3rd, 2010, 08:42 AM posted to microsoft.public.word.tables
Graham Mayor
external usenet poster
 
Posts: 18,297
Default Search & Replace

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?



  #3  
Old January 4th, 2010, 12:22 PM posted to microsoft.public.word.tables
Johann Swart
external usenet poster
 
Posts: 41
Default Search & Replace

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?



.

  #4  
Old January 4th, 2010, 12:38 PM posted to microsoft.public.word.tables
DeanH
external usenet poster
 
Posts: 1,783
Default Search & Replace

Johann.
It was Macropod that suggested the ^10, and as you say this does not work
this [space]^10. I am still hoping for a solution.
What can work though if you are purely wanting to get rid of the superfluous
space before the cell end marker is to use the "old" trick of selecting the
text, align centre then align left (or left then centre). This will remove
all superfluous spaces, tabs, etc. at the end of paragraphs selected.
This works well, but obviously enusre that you select the text only not the
whole table, else the table itself will be aligned. I tend to select by
column, say columns 1 and 2 out of a 3-column table, do the trick, the n
select column 3 on its own, do the trick.
Not the best but does work well.
Lets see if anyone else can help with the Replace on [space] Cell End Marker.
Hope this helps
DeanH


"Johann Swart" wrote:

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?



.

  #5  
Old January 4th, 2010, 02:28 PM posted to microsoft.public.word.tables
Graham Mayor
external usenet poster
 
Posts: 18,297
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?



.



  #6  
Old January 4th, 2010, 02:32 PM posted to microsoft.public.word.tables
Graham Mayor
external usenet poster
 
Posts: 18,297
Default Search & Replace

To process all the tables change that to

Dim oRng As Range
Dim oTable As Table
For Each oTable In ActiveDocument.Tables
With oTable
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
Next oTable


--

Graham Mayor - Word MVP

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




"Graham Mayor" wrote in message
...
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?


.





  #7  
Old January 5th, 2010, 09:46 AM posted to microsoft.public.word.tables
DeanH
external usenet poster
 
Posts: 1,783
Default Search & Replace

Hello Graham.
Many thanks for these two macros.
Unfortunately both fail at:
Set oRng = .Cell(I, j).Range

Any ideas?
DeanH


"Graham Mayor" wrote:

To process all the tables change that to

Dim oRng As Range
Dim oTable As Table
For Each oTable In ActiveDocument.Tables
With oTable
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
Next oTable


--

Graham Mayor - Word MVP

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




"Graham Mayor" wrote in message
...
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?


.





.

  #8  
Old January 3rd, 2010, 09:57 AM posted to microsoft.public.word.tables
macropod[_2_]
external usenet poster
 
Posts: 2,402
Default Search & Replace

Hi Johann,

You can also use ^10 with wildcards, and this works with the table cell markers as well.

--
Cheers
macropod
[Microsoft MVP - Word]


"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?

  #9  
Old January 4th, 2010, 10:43 AM posted to microsoft.public.word.tables
DeanH
external usenet poster
 
Posts: 1,783
Default Search & Replace

Hello Macropod (Happy New Year)
This ^10 does not work in the Find/Replace with wildcards checked.
I have 2003 on XP, should this work?
I have for many years wanted to find the code for the cell markers with no
joy, so any calification would be much appreciated.
Many thanks
DeanH


"macropod" wrote:

Hi Johann,

You can also use ^10 with wildcards, and this works with the table cell markers as well.

--
Cheers
macropod
[Microsoft MVP - Word]


"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?

.

  #10  
Old January 4th, 2010, 10:51 AM posted to microsoft.public.word.tables
DeanH
external usenet poster
 
Posts: 1,783
Default Search & Replace

Sorry, to clarify.
^10 does work but not on its own or with a space before.
As previously described in a previous posting, if you search for Wa^10 -
this will be found, But [space]^10 will not be found, any space will be found.
I have noticed Doug's macro and may have a play with that, any other ideas?
Thanks
DeanH


"DeanH" wrote:

Hello Macropod (Happy New Year)
This ^10 does not work in the Find/Replace with wildcards checked.
I have 2003 on XP, should this work?
I have for many years wanted to find the code for the cell markers with no
joy, so any calification would be much appreciated.
Many thanks
DeanH


"macropod" wrote:

Hi Johann,

You can also use ^10 with wildcards, and this works with the table cell markers as well.

--
Cheers
macropod
[Microsoft MVP - Word]


"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
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:51 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.