![]() |
#1
|
|||
|
|||
![]()
Hello all!
In a previous post (https://www.msofficeforums.com/word-...le-choice.html) I had great help and this is a follow up request: Is it possible to have a macro delete particular paragraphs within a table that are in a series (sorry, I apologize if I used the wrong terminology). I have included a sample with the current formatting. 94.Test Question A E. Answer *delete this portion ->Long long long long long explaination. Long long long long long explaination. Long long long long long explaination. Long long long long long explaination. Long long long long long explaination. <-delete this portion* |
#2
|
||||
|
||||
![]()
For that, you could use a macro like:
Code:
Sub UpdateTables() Application.ScreenUpdating = False Dim Tbl As Table, Rng1 As Range, Rng2 As Range With ActiveDocument For Each Tbl In .Tables With Tbl If .NestingLevel = 1 Then Set Rng1 = .Cell(1, 1).Range With Rng1 .End = .End - 1 If (.Text Like "#.") Or (.Text Like "##.") Or (.Text Like "###.") Then Set Rng2 = .Rows(1).Cells(2).Range With Rng2 .End = .End - 1 While .Paragraphs.Last.Range.Tables(1).NestingLevel = 1 .Paragraphs.Last.Range.Text = vbNullString Wend End With End If End With End If End With Next End With Set Rng1 = Nothing: Set Rng2 = Nothing Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro Needed to Delete Unneeded Answers in Multiple Choice Format Question | frustrated teacher | Word VBA | 6 | 05-02-2014 03:37 AM |
Delete lots of empty space between paragraphs. | FieldTechnician | Word | 4 | 10-25-2013 01:14 PM |
![]() |
Jamal NUMAN | Word | 3 | 07-27-2011 04:19 AM |
Select Series Color - Macro | judicial85 | Excel Programming | 0 | 03-14-2011 02:35 PM |
![]() |
geobruin | Word | 1 | 06-12-2009 06:55 AM |