![]() |
#6
|
||||
|
||||
![]()
The coding for this is going to be simplest if you (temporarily) paste the abbreviations table into the main document to run this code. This code assumes you pasted the table at the very end of the document.
Code:
Sub CheckAcroInUse() Dim aTbl As Table, sAbb As String, aRng As Range, aCell As Cell Set aTbl = ActiveDocument.Tables(ActiveDocument.Tables.Count) Set aRng = ActiveDocument.Range(0, aTbl.Range.Start) For Each aCell In aTbl.Columns(1).Cells sAbb = Split(aCell.Range.Text, vbCr)(0) If InStr(aRng.Text, sAbb) = 0 Then aCell.Range.HighlightColorIndex = wdYellow End If Next aCell End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
Tags |
word vba, word vba code, word vba highlight text |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
AtaLoss | Word VBA | 37 | 09-22-2021 12:04 PM |
How to redact words listed in one document from the current document | AlanofBayCourt | Word VBA | 0 | 10-31-2019 03:00 AM |
Find and highlight multiple words in MS Word document | qkjack | Word VBA | 7 | 02-21-2018 07:09 PM |
![]() |
KeithLee22 | Word VBA | 2 | 11-11-2015 03:37 PM |
Find and highlight multiple words in a document | flatop | Word VBA | 3 | 04-16-2014 10:29 PM |