![]() |
|
|
|
#1
|
||||
|
||||
|
You need to look at the invisible characters in your text file.
sFind = "Ampac implies that following the word Ampac is something else, like a new line rather than " Warranty". I would expect it to be showing sFind = "Ampac Warranty" You can add a Watch to the sFind variable to monitor its value is while the macro is running. The macro assumes that the search terms are separated by a vbCrLf which translates to a Carriage Return/Line Feed in a text file. If your text file contents is structured differently to what the macro assumes then the code will need to be adjusted to correctly deal with the ACTUAL contents of the text file rather than the assumed contents.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
#2
|
|||
|
|||
|
Quote:
This is an example of what the .txt document looks like Screenshot 2023-01-24 102823.png I've tried to add extra spaces to the end and new lines between the phrases but this did not work |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Find and highlight multiple words in MS Word document
|
AtaLoss | Word VBA | 37 | 09-22-2021 12:04 PM |
Macro To Identify & Highlight Words In MS Word Based Upon A List In Excel File Column
|
abhimanyu | Word VBA | 5 | 03-20-2020 01:33 PM |
| How to find (highlight) two and more words in a list of 75k single words in Word 2010 | Usora | Word | 8 | 05-29-2018 03:34 AM |
| Find and highlight multiple words in MS Word document | qkjack | Word VBA | 7 | 02-21-2018 07:09 PM |
| Macro to highlight repeated words in word file and extract into excel file | aabri | Word VBA | 1 | 06-14-2015 07:20 AM |