The first part of your request is pretty easy.<BR><BR>x = int(rnd * max) + 1<BR><BR>The second part is not as easy. There is no guarantee with any random number generator that a number will not repeat.<BR><BR>Most of the time people ask for this, it's because they want a unique record ID of some sort for their database. Is that why you are asking as well? If so, you should consider using identity fields (in SQL Server) or the AutoNumber feature in Access) for that purpose. If not, then perhaps if you explain how you want to use this, we could help you come up with a robust system that will not repeat within a given range.