Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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



 
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 09:46 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"