I am having trouble in developing a macro to look through a word document and change the background colour columns in a table.
The macro needs to look at each table in the word document, and if a cell has the text 'PH' then the column of that cell needs to change the background colour.
It's been a while since I used VB. I've tried cell.range too as well as Selection.Find below but just keep getting errors.
Private Sub Document_Open()
Dim Tbl As Table
Dim Cel As Cell
Dim Rw As Row
Dim Col As Columns
For Each Tbl In ActiveDocument.Tables
Set Col = Tbl.Columns
For Each c In Col
With Selection.Find
.Execute FindText:="Public Holiday"
c.Shading.BackgroundPatternColorIndex = wdRed
End With
Next
Next
End Sub