Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.word.tables
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cell referencing in table formulas - just ONE adjacent cell | Tables | |||
How do I move from cell to cell iin a table column in Word 2003? | Tables | |||
cell marker missing - can not type text into cell | Tables | |||
How to wrap text from cell to cell in a table. | Tables | |||
How do I auto copy data from cell in a word table to another cell. | New Users |