View Single Post
 
Old 01-23-2023, 07:34 PM
Big_Sugah Big_Sugah is offline Windows 10 Office 2016
Novice
 
Join Date: Jan 2023
Posts: 5
Big_Sugah is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
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.
Hi Guessed,

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