<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Excel Zoom &#187; Random</title>
	<atom:link href="http://excelzoom.com/tag/random/feed/" rel="self" type="application/rss+xml" />
	<link>http://excelzoom.com</link>
	<description>...because it&#039;s more than just a calculator</description>
	<lastBuildDate>Wed, 02 Sep 2009 20:43:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Random Numbers in Excel</title>
		<link>http://excelzoom.com/2009/02/random-numbers-in-excel/</link>
		<comments>http://excelzoom.com/2009/02/random-numbers-in-excel/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 23:20:29 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Macros]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://excelzoom.com/?p=33</guid>
		<description><![CDATA[Sometimes it is useful to be able to generate random numbers in Excel that are limited to a certain range. Maybe you have an &#8220;employee of the month&#8221; contest and you just can&#8217;t pick one. Assign a number to each employee, enter the first and last numbers and run the macro. And who said decision [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it is useful to be able to generate random numbers in Excel that are limited to a certain range.</p>
<p>Maybe you have an &#8220;employee of the month&#8221; contest and you just can&#8217;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!</p>
<p>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).</p>
<p>Copy all of the code below. Paste it into your workbook&#8217;s Visual Basic editor, either under a Microsoft Excel Object or Module. The only two spots you&#8217;ll need to change are the numbers 1 and 200 after &#8220;Lowest =&#8221; and &#8220;Highest =&#8221;. Replace these values with whatever high/low values you wish to use.</p>
<p>Need help? Use our <a href="http://excelzoom.com/?p=7">nifty guide</a> to help figure out how to install and use your macros.<br />
<code><br />
Sub RandomNumber()<br />
'<br />
'MACROS BY EXCELZOOM.COM<br />
'<br />
Application.ScreenUpdating = False<br />
Dim cell As String<br />
Dim cellRg As Range<br />
Dim cellselection As Range<br />
Dim Lowest As Double<br />
Dim Highest As Double<br />
Dim R As Double<br />
Lowest = 1 'ENTER THE LOWEST NUMBER HERE<br />
Highest = 200 'ENTER THE HIGHEST NUMBER HERE<br />
For Each cellselection In Selection<br />
R = Int((Highest - Lowest + 1) * Rnd() + Lowest)<br />
cell = cellselection<br />
cell = R<br />
cellselection = cell<br />
Next<br />
Application.ScreenUpdating = True<br />
End Sub</code></p>
<!-- Easy AdSense V2.61 -->
<!-- Post[count: 2] -->
<div class="ezAdsense adsense adsense-leadout" style="float:left;margin:12px;"><script type="text/javascript"><!--
google_ad_client = "pub-0662082843230645";
/* Excel Zoom Post Bottom468x60, created 5/31/09 */
google_ad_slot = "1891900730";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>]]></content:encoded>
			<wfw:commentRss>http://excelzoom.com/2009/02/random-numbers-in-excel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
