Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub ColorTable()
Dim MyTable As Table
Dim MyRow As Row
Dim MyCell As Cell
Set MyTable = ActiveDocument.Tables(1)
For Each MyRow In MyTable.Rows
For Each MyCell In MyRow.Cells
If MyCell.Range.Text Like "Blue*" Then
MyCell.Shading.BackgroundPatternColor = wdColorBlue
ElseIf MyCell.Range.Text Like "Red*" Then
MyCell.Shading.BackgroundPatternColor = wdColorRed
ElseIf MyCell.Range.Text Like "Yellow*" Then
MyCell.Shading.BackgroundPatternColor = wdColorYellow
ElseIf MyCell.Range.Text Like "Green*" Then
MyCell.Shading.BackgroundPatternColor = wdColorGreen
End If
Next MyCell
Next MyRow
Set MyCell = Nothing
Set MyRow = Nothing
Set MyTable = Nothing
End Sub