Hi, I have just managed to colour code a drop down list in Word with a macro (even though I've never done anything like that before!) but can I have two different drop down lists (called different names) with different colour coding in the same document?
I used this for the first one:
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
With ContentControl.Range
If ContentControl.Title = "CC" Then
Select Case .Text
Case "NC"
.Cells(1).Shading.BackgroundPatternColor = wdColorRed
Case "OBS"
.Cells(1).Shading.BackgroundPatternColor = wdColorLightOrange
Case "GP"
.Cells(1).Shading.BackgroundPatternColor = wdColorLime
Case "REC"
.Cells(1).Shading.BackgroundPatternColor = wdColorSkyBlue
Case "NI"
.Cells(1).Shading.BackgroundPatternColor = wdColorGray15
Case Else
.Cells(1).Shading.BackgroundPatternColor = wdColorAutomatic
End Select
End If
End With
End Sub
I've tried copying and pasting this into the same module and another one (changing the title name) but I'm obviously doing something wrong?