Actually, this is probably a better macro to start with. Take a look, and let me know how it goes.
For more information, see the wiki Searching the Forum for Answers section.