Mark, I added your function to my project and it works great! I have some lines that have tabs in them. How can I modify your function so that it does not count lines if there is a tab in a line in addition to lines having “CHC”? Charles Szasz cszasz at mac.com