See the Repeat macros here.
For more information, see the wiki Searching the Forum for Answers section.