Let's say i hae an array with 45 rows...

Is there a way to prompt the user to select which rows they wish to view? (example: 1-5 or 16-20)

Also, if they were to go over 45 rows, how should I display the error message?