![]() |
|
#15
|
||||
|
||||
|
Assuming all the dropdowns are meant to have the same conditional shading outcomes, the following code is all you'll need.
Code:
Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean)
Application.ScreenUpdating = False
Dim lClr As Long
With CCtrl
If .Type <> wdContentControlDropdownList Then Exit Sub
With .Range
If .Information(wdWithInTable) = False Then Exit Sub
Select Case .Text
Case "N/R": lClr = wdColorLightTurquoise
Case "Yes": lClr = wdColorPink
Case "No": lClr = wdColorBrightGreen
Case Else: lClr = wdColorAutomatic
End Select
.Cells(1).Range.Shading.BackgroundPatternColor = lClr
End With
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Macro to keep formatted form fields after mail merge or replace text with formatted form fields | jer85 | Word VBA | 2 | 04-05-2015 10:00 PM |
Reinstalling Office 2013 after factory reset
|
barryd | Office | 1 | 05-17-2013 04:24 PM |
| Form Fields in Word | jwm1346 | Word | 1 | 04-17-2012 07:02 PM |
Preventing Form Fields to Reset
|
PosseJohn | Word VBA | 4 | 07-15-2011 09:44 PM |
| Form fields in Word messed up | mba | Word VBA | 0 | 02-07-2010 09:54 PM |