View Single Post
 
Old 10-15-2015, 06:58 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote