View Single Post
 
Old 06-20-2017, 07:47 AM
OfficeAssociate99 OfficeAssociate99 is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: May 2017
Posts: 19
OfficeAssociate99 is on a distinguished road
Default

Hey man, this amazing, thanks for all your help. It works (almost) as intended with one exception. Every time I run it, I get runtime error 91 on this line:
Code:
Loop Until InStr(myKeyTerms, mySecondRange) > 0
However, if I add a non-defined category, then it works as intended (cuts the category) before once again returning runtime error 91 "object not defined"
Any ideas? I'm running some basic tests, but I'm sure you have a much better idea of possible causes...

EDIT 1:
I think I've figured it out. If an undefined category is inserted at the end, the code outputs an error, because there is no defined category to use as a reference against.

EDIT 2:
I think I have a solution - I changed the line to this:
Code:
Loop Until InStr(myKeyTerms, mySecondRange) > 0 Or myFirstRange Is Nothing
I'll run a few more tests, but the end is sight! Thanks again
Reply With Quote