SUMMARY Word table question

Subject: SUMMARY Word table question
From: Michael Collier <mcollier -at- CSC -dot- COM>
Date: Wed, 1 Jul 1998 14:07:29 -0500

Michael Collier wrote:
>
> I have a twelve page table done in Word where I'd like to delete all of the rows
> where column 2 has a certain value (the letter C, in this case--the value for
> Column 2 can be C, I or M). Style formatting is not used.
>
> I need to delete the entire row, not just the letter. Find/Replace does not
seem
> to help. Any suggestions, like how to write a macro to do this, or move the data
> to Excel and work with it?

Thanks to all who sent suggestions. Two types of solutions were offered: sort by
the desired column and delete, or write a macro. The sort solutions are simple
enough to execute, though I am suspicious that sorting will disrupt the
hierearchical relationship among the the rows. But the sort suggestion offered by
& and / may address that:

1. Add a new column (you'll be deleting it later, so don't adjust the
existing column widths; just tack it on the right).
2. Manually number the rows by typing numbers into the new column. Don't
use autonumbers.
3. Sort the table on the column that has C, I, M
4. Select all of the C rows as a block and delete them.
5. Sort the table on the numbered column.
6. Delete the numbered column.

Chris Knight offered this macro:

Here's a macro that seems to work:
Sub MAIN
REM Put the cursor anywhere in the column you want to check for "C"
TableSelectColumn
NumRows = SelInfo(15)
For i = 1 To NumRows
EditGoTo .Destination = "\Cell"
CharLeft 1, 1
If Selection$() = "C" Then
TableSelectRow
TableDeleteRow
Else
If i < NumRows Then
EndOfRow(1)
NextObject
NextObject
EndOfColumn(1)
EndIf
EndIf
Next i
TableSelectColumn
CharLeft 1
End Sub


Since I may end up with six or seven tables like this, I think the time is well
worth investing in writing and testing the macro.

Later,

Michael Collier
mcollier -at- csc -dot- com




Previous by Author: Prepositions at the end of a sentence (was: 'directions below' or 'below directions'?)
Next by Author: Re: Concurrent writing and revision
Previous by Thread: Re: Icons in running text
Next by Thread: Re: MIL STDs for online intra/extra 'net' docs


What this post helpful? Share it with friends and colleagues:


Sponsored Ads