Sometimes it is useful to be able to generate random numbers in Excel that are limited to a certain range.
Maybe you have an “employee of the month” contest and you just can’t pick one. Assign a number to each employee, enter the first and last numbers and run the macro. And who said decision making was difficult!
Or, on the serious side you could be doing some testing that requires a random number to fall within a certain range. You can select as many cells as you wish to populate with a random number, and each one will be assigned a truly random numbers. (i.e. All numbers within the range have the ability to be repeated).
Copy all of the code below. Paste it into your workbook’s Visual Basic editor, either under a Microsoft Excel Object or Module. The only two spots you’ll need to change are the numbers 1 and 200 after “Lowest =” and “Highest =”. Replace these values with whatever high/low values you wish to use.
Need help? Use our nifty guide to help figure out how to install and use your macros.