Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
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
  #2  
Old 08-19-2021, 03:51 AM
laith93 laith93 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 2019
Competent Performer
Highlight words in a table that does not exist in current document
 
Join Date: Jul 2021
Posts: 117
laith93 is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
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.
Wow, wow, wow
Amazing and fantastic
Which brain do you have
That is exactly what I want
Thank you so much Mr. Andrew

My abbreviations table is already present in the active document, I just moved it temporarily to the end of the document.

Thank you again
Best whishes
Reply With Quote
Reply

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



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 07:29 PM.


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