View Single Post
 
Old 08-19-2021, 01:35 AM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote