FredrikNilsen
New Member
- Joined
- Jan 25, 2021
- Messages
- 26
- Office Version
- 365
- 2019
- 2016
- 2013
- Platform
- Windows
Hello,
I have a document with several tables. Some of the tables have rows with specific words ("Program", "Time"). I would like to search through the document, find each row with those words, and apply a specific style ("P1", "P2") to the whole row with the words. I have started with a code to clean up the tables first, but I don't know how to search for the rows and apply the styles.
I have a document with several tables. Some of the tables have rows with specific words ("Program", "Time"). I would like to search through the document, find each row with those words, and apply a specific style ("P1", "P2") to the whole row with the words. I have started with a code to clean up the tables first, but I don't know how to search for the rows and apply the styles.
VBA Code:
Dim Tbl As Table
For Each Tbl In ActiveDocument.Tables
Tbl.Range.Font.Name = "Arial Nova"
Tbl.Range.Rows.HeightRule = wdRowHeightAuto
Tbl.Range.Font.Size = 10
Next Tbl