![]() |
|
|
|
#1
|
|||
|
|||
|
Good afternoon,
First time post so please forgive me if it is in the wrong place. I have a document which has tables, each table having several rows and two columns. The first question in each table is a yes/no answer using a drop down combo box in the right column. Is there a way to delete all rows under the first row if the question answer is 'no' using a macro based on content control exit? I have uploaded an example which appears similar to my document. In my document I already have content control on exit for dropdowns tagged as RP which format the cell background colour. Thanks |
|
#2
|
||||
|
||||
|
That could be as simple as:
Code:
Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean) If CCtrl.Range.Text = "No" Then CCtrl.Range.Rows(1).Delete End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| VBA content control on exit delete rows | JakeD | Word Tables | 1 | 08-23-2022 03:38 PM |
Help please adding a macro to add a table row to a content control table on exit
|
graw76 | Word Tables | 1 | 03-26-2021 03:37 PM |
| VBA Adding Rows To Table With Content Control | lord_kaiser | Word VBA | 2 | 08-01-2020 01:01 AM |
VBA error Content Control On Exit
|
jec1 | Word VBA | 5 | 08-16-2014 08:14 PM |
Deleting a table from a content control -- preserving the content control
|
BrainSlugs83 | Word Tables | 8 | 11-14-2013 03:06 AM |