Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 08-19-2021, 01:35 AM
Guessed's Avatar
Guessed Guessed is offline Highlight words in a table that does not exist in current document Windows 10 Highlight words in a table that does not exist in current document Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
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
 

Tags
word vba, word vba code, word vba highlight text

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Highlight words in a table that does not exist in current document Find and highlight multiple words in MS Word document 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
Highlight words in a table that does not exist in current document Using VBA to Compare and Highlight words in a Word Table's Row/Cell 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

Other Forums: Access Forums

All times are GMT -7. The time now is 05:04 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft