Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
JERRY JERRY is offline
external usenet poster
 
Posts: 288
Default Finding the End of the Cell

In Word 2000, is there a way to use the Find and Replace dialog to find the
last character(s) in a table cell? For example, if I wanted to find all table
cells containing text that ended in the letter s...
Thanks,Jerry
  #2   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Finding the End of the Cell

I do not thing that you can do it with the Find and Replace dialog. It can
however be done using VBA. Best if you tell us what you want to do when you
find such cells so that we can give you an appropriate response that
addresses that.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Jerry" wrote in message
...
In Word 2000, is there a way to use the Find and Replace dialog to find
the
last character(s) in a table cell? For example, if I wanted to find all
table
cells containing text that ended in the letter s...
Thanks,Jerry



  #3   Report Post  
Posted to microsoft.public.word.tables
JERRY JERRY is offline
external usenet poster
 
Posts: 288
Default Finding the End of the Cell

Doug,
Here's more information: I see a lot of tables that, for a variety of
reasons, have one or more characters that need to be deleted at the end of
some (not necessarily all) cells. In the one I'm working on now, I'd like to
be able to remove "/ " (slash space) whenever it appears at the end of a cell
(and from nowhere else).
Jerry

"Doug Robbins - Word MVP" wrote:

I do not thing that you can do it with the Find and Replace dialog. It can
however be done using VBA. Best if you tell us what you want to do when you
find such cells so that we can give you an appropriate response that
addresses that.

  #4   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Finding the End of the Cell

The following code in a macro will ask you to enter the character that is at
the end of the cells that you want to delete and then do all of the
deletions for you::

Dim delchar As String
delchar = InputBox("Enter the character at the end of the cells that you
want to delete.")
Dim cellrange As Range
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(findText:=delchar, Forward:=True, Wrap:=wdFindStop) =
True
If Selection.Information(wdWithInTable) Then
Set cellrange = Selection.Cells(1).Range
cellrange.End = cellrange.End - 1
If Selection.Range.End = cellrange.End Then
Selection.Range.Delete
End If
End If
Loop
End With



--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Jerry" wrote in message
...
Doug,
Here's more information: I see a lot of tables that, for a variety of
reasons, have one or more characters that need to be deleted at the end of
some (not necessarily all) cells. In the one I'm working on now, I'd like
to
be able to remove "/ " (slash space) whenever it appears at the end of a
cell
(and from nowhere else).
Jerry

"Doug Robbins - Word MVP" wrote:

I do not thing that you can do it with the Find and Replace dialog. It
can
however be done using VBA. Best if you tell us what you want to do when
you
find such cells so that we can give you an appropriate response that
addresses that.



  #5   Report Post  
Posted to microsoft.public.word.tables
JERRY JERRY is offline
external usenet poster
 
Posts: 288
Default Finding the End of the Cell

That does the trick. Thanks!

"Doug Robbins - Word MVP" wrote:

The following code in a macro will ask you to enter the character that is at
the end of the cells that you want to delete and then do all of the
deletions for you::

Dim delchar As String
delchar = InputBox("Enter the character at the end of the cells that you
want to delete.")
Dim cellrange As Range
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(findText:=delchar, Forward:=True, Wrap:=wdFindStop) =
True
If Selection.Information(wdWithInTable) Then
Set cellrange = Selection.Cells(1).Range
cellrange.End = cellrange.End - 1
If Selection.Range.End = cellrange.End Then
Selection.Range.Delete
End If
End If
Loop
End With



--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

Reply
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
Cell referencing in table formulas - just ONE adjacent cell Ngan Tables 5 May 20th 06 02:10 AM
How do I move from cell to cell iin a table column in Word 2003? MOSwannabe Tables 4 January 26th 06 10:17 PM
cell marker missing - can not type text into cell Mary Smith 360 Tables 1 December 20th 05 05:04 AM
How to wrap text from cell to cell in a table. Jon Coulson Tables 2 August 8th 05 09:12 PM
How do I auto copy data from cell in a word table to another cell. Nev New Users 1 February 4th 05 08:51 PM


All times are GMT +1. The time now is 12:53 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"