View Single Post
 
Old 05-04-2023, 03:47 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Your code is non-functioning. If I correct the missing line to allow it to work we can also allow two options for Str or Strong
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
  With ContentControl
    Select Case .Title
        Case "CE"
          Select Case .Range.Text
            Case "Strong", "Str": .Range.Cells(1).Shading.BackgroundPatternColor = 6299648: .Range.Cells(1).Range.Font.ColorIndex = wdWhite
            Case "Weak": .Range.Cells(1).Shading.BackgroundPatternColor = 4739264: .Range.Cells(1).Range.Font.ColorIndex = wdWhite
            Case "Sat": .Range.Cells(1).Shading.BackgroundPatternColor = 5880731: .Range.Cells(1).Range.Font.ColorIndex = wdBlack
            Case "IN": .Range.Cells(1).Shading.BackgroundPatternColor = 5232127: .Range.Cells(1).Range.Font.ColorIndex = wdBlack
            Case Else: .Range.Cells(1).Shading.BackgroundPatternColorIndex = wdNoHighlight
          End Select
    End Select
  End With
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote