Since @Michiel posted his updated macro here it might be hard to find. So I moved it to the "macro" category:
For more information, see the wiki Searching the Forum for Answers section.