• Blog
  • Excel Downloads
    • Audit Tickmark Toolbar
  • Courses
    • Power BI
  • Contact
  • Checkout

Excel Zoom

...because it's more than just a calculator


Random Numbers in Excel

February 4, 2009 by Mark 2 Comments

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.

You must be logged in and have an active membership to view this content. Please register or login to continue.

Filed Under: Macros Tagged With: Macros, Random

Looking For More Help?

Contact us with any specific questions or feedback. We love to hear from you!

Recommend a new product and EARN! Contact us here for info

Need to level up your career? See our amazing Excel Courses here

Looking for the Excel Audit Tickmark Toolbar? Click Here, NOW ONLY $97!

Subscribe to our mailing list
  • Facebook
  • Twitter

Search this site…

Power BI Webinar
Power BI Course
Free Excel Dashboard Webinar

Copyright © 2025 · Magazine Pro Theme on Genesis Framework

Login Form

Lost your password?