I always think that questions that involve taking the time to write code are worth more than a simple question that just gets an answer based on general knowledge...
I've modified my code so that it'll keep going until you get 15 blank lines in a row. I'm assuming that this will be enough of a check to assume that the data has ended.
I changed this do you can call the function like this:
DoTheSearch "String to Search For at Beginning of Line", "COL"
where COL is the column letter that you want to copy this value to.
The example copies anything that starts with "AT " to column B and anything that starts with "PRIORITY " to column C. Adjust as necessary.