You may use the Counter VHDL template provided in the Quartus tool itself. Insert template> VHDL > Full Design > Arithmetic > Counter > Binary Counter.
Change the MIN_COUNT and MAX_COUNT to your desired range, and you should be able to set the counter range.
Though you need to change the conditional statement so it get the correct value when it reset or reach the max range. I will leave the work to you.
Best Regards,
Richard Tan
p/s: If any answer from the community or Intel Support are helpful, please feel free to give best answer or rate 9/10 survey.