Please read the Announcement topic at the top of the sub-Forum to learn how to correctly post code along with other helpful advice.

To code what you've described, put the desired "repeating code"...