The help file has so much on this. I could cut and paste pages here, but it would be quicker for you to check out what's there and then ask specific questions here when and if you get stuck (also letting us know what version you are using). Start with "Loop Creation and Basic Looping Techniques" in the help file.