Hello,
How do I set conditional formatting to highlight the entire row in a table?
My document has 4 columns. In one of the columns I have a drop down content control box that I would like to use in order to change the color fill for the entire row.
The code below only highlights that particular cell rather than the whole row:
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
With ContentControl
If Len(.Title) < 6 Then Exit Sub
If Left(.Title, 6) = "Status" Then
Select Case .Range.Text
Case "COMPLETE": .Range.Cells(1).Shading.BackgroundPatternColorIndex = wdGreen
Case "Pending": .Range.Cells(1).Shading.BackgroundPatternColorIndex = wdYellow
Case Else: .Range.Cells(1).Shading.BackgroundPatternColorIndex = wdNoHighlight
End Select
End If
End With
End Sub