Dave, thank you so much! It works like a champ, and fixes the last broken
link in a chain of macros to help me with my reports. I've got reports with
multiple tables of interim report numbers broken out by classifications.
When the master Excel spreadsheet of interim reports was updated, it could
take 2-3 hours to compile a list of new numbers and slog through a report
checking them. Now, I compile a list from the spreadsheet, check that list
against the report and highlight the ones that match, reporting the ones
that didn't match. The bugaboo was to go through the report, find the
correct tables and find the interim numbers that didn't get highlighted.
Your code provided the final piece of the puzzle - now the whole process
takes less than five minutes!
I couldn't make it work as a separate function, though, so I had to take the
code and insert it directly into the loop. Caused some consternation with
Ifs and Withs, but that's just due to my inexperience (didn't know how to
call the function, pass the answer into the sub, and which has to terminate
first - the If or the With). But it's working now!
Many, many thanks!
Ed
Dave Lett said:
Hi Ed,
Yes, oRng is range for text only and oClRng is the entire cell range.
If you put the function in a loop, then no, you don't need to set oRng and
oClRng to = Nothing at every loop (they get redefined as you change the
row/column; just make sure that the Set for each is in the loop). AFAIK, it
is good practice to set them to =Nothing at the end of the sub.