<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 Forums - Coffeehouse - Simulations using Excel</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Forums/rss"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 Forums - Coffeehouse - Simulations using Excel</title>
		<link>http://channel9.msdn.com/Forums</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Forums</link>
	<language>en</language>
	<pubDate>Thu, 23 May 2013 15:46:49 GMT</pubDate>
	<lastBuildDate>Thu, 23 May 2013 15:46:49 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>16</c9:totalResults>
	<c9:pageCount>-16</c9:pageCount>
	<c9:pageSize>-1</c9:pageSize>
	<item>
		<title>Coffeehouse - Simulations using Excel</title>
		<description><![CDATA[<p>Hi members,<br>
<br>
I am a high school teacher ( more details in my profile ).<br>
<br>
I have one student who is modelling travel times between bus stops on&nbsp;a particualar bus route. The model assumes that the
<strong>Total Travel time</strong> between two bus stops is the <strong>Passenger loading time</strong>&nbsp;plus the&nbsp;<strong>Bus travel time</strong> between the stops.
<br>
<br>
The <strong>Passenger loading time</strong> is dependent on the number of&nbsp;passengers (&nbsp;<strong>No. of passengers</strong> )&nbsp;who wish to board the bus multiplied by the time is takes to serve each of them. This
<strong>Serving time per passenger</strong>&nbsp;is taken to be a constant ( 10 seconds per passenger, for illustrative purposes ). No considersation is made for the time it takes to off load passengers. ( We assume that the time it takes for off-loading passengers
 to leave the bus&nbsp;does not influence the model )<br>
<br>
The <strong>Bus travel time </strong>between&nbsp;bus stops is taken to be a constant. So no consideration for varying amounts of traffic on route or speed of the&nbsp;bus&nbsp;is made.<br>
<br>
So in brief, <br>
<strong>Total Travel time = Passenger loading time &#43; Bus travel time <br>
<br>
</strong>where, <br>
<br>
<strong>Passenger loading time =&nbsp;No. of Passengers * Serving time per passenger<br>
<br>
No. of Passengers = RANDBETWEEN(0,15) <br>
(RANDBETWEEN(0,15)&nbsp; generates a random number between some limits )<br>
<br>
<br>
FINALLY...., ( sorry, if it was too much of&nbsp;mouthful )<br>
<br>
</strong>The point is I wish to use Excel to run the simulation a 1000 times. If you like refresh the calculations so that new random numbers of passengers&nbsp;will be generated and hence&nbsp;different
<strong>Passenger loading times</strong>. And then collect a frequency distribution&nbsp;for&nbsp;different&nbsp;classes of observations (
<strong>Total&nbsp;Travel times</strong> ) in table from which&nbsp;a histogram could be generated using the Excel wizard chart functionality.<br>
<br>
How can this be done in code ?&nbsp;Using&nbsp;a subroutine and perhaps a single button to start the simulation on the spreadsheet.. ?<br>
<br>
I hope it makes sense. And I hope it is not too much to ask this forum.<br>
<br>
Keli<br>
<br>
</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/194104#194104</link>
		<pubDate>Wed, 31 May 2006 11:05:42 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/194104#194104</guid>
		<dc:creator>Keli</dc:creator>
		<slash:comments>16</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Keli/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Simulations using Excel</title>
		<description><![CDATA[<p>Have you ever tried to do something like this in .NET? You could write a simple console application that outputs the results as CSV files (comma separated files). you can then open those directly in Excel and create the charts etc.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/8230a380a10341bb91e49deb0168cc74#8230a380a10341bb91e49deb0168cc74</link>
		<pubDate>Wed, 31 May 2006 11:11:10 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/8230a380a10341bb91e49deb0168cc74#8230a380a10341bb91e49deb0168cc74</guid>
		<dc:creator>Christian Liensberger</dc:creator>
		<slash:comments>16</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/littleguru/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Simulations using Excel</title>
		<description><![CDATA[<p>Sorry, if that isn't clear, we are working within Excel. So we are going to be trying to use the cells in the worksheet as our working environment.<br>
<br>
I was thinking more in terms of creating macros, subroutines ... etc <br>
<br>
Keli<br>
<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/947552b2e05341c3b2e99deb0168cc9f#947552b2e05341c3b2e99deb0168cc9f</link>
		<pubDate>Wed, 31 May 2006 15:53:02 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/947552b2e05341c3b2e99deb0168cc9f#947552b2e05341c3b2e99deb0168cc9f</guid>
		<dc:creator>Keli</dc:creator>
		<slash:comments>16</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Keli/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Simulations using Excel</title>
		<description><![CDATA[<p>There's only 15 possible outcomes and all you'd be doing is measuring the randomness of Excel's random number generator, which should result in an even distribution. Or am I missing something? I managed to miss statistics in school.<br>
<br>
In any case, how about putting your constants at the top of your sheet, make one row of formulas based on a single random value, and copying that down for 1000 rows? Then do your stats and charts on that table's data.<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/ed18e96f6d0a4360b53a9deb0168ccca#ed18e96f6d0a4360b53a9deb0168ccca</link>
		<pubDate>Thu, 01 Jun 2006 00:21:20 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/ed18e96f6d0a4360b53a9deb0168ccca#ed18e96f6d0a4360b53a9deb0168ccca</guid>
		<dc:creator>DCMonkey</dc:creator>
		<slash:comments>16</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/DCMonkey/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Simulations using Excel</title>
		<description><![CDATA[<p>You should be able to put your model, including all variables and relationships between them, in two rows; with the first row being the variable names, and the second row being the formulas.<br>
<br>
<br>
<table cellpadding="2" cellspacing="1">
<tbody>
<tr>
<td>
<p>Passengers</p>
</td>
<td>
<p>Time Per Passenger</p>
</td>
<td>
<p>Passenger Loading Time</p>
</td>
<td>
<p>Bus Travel Time</p>
</td>
<td>
<p>Total Travel Time</p>
</td>
</tr>
<tr>
<td>
<p>=Rand(…)</p>
</td>
<td>
<p>10</p>
</td>
<td>
<p>=A2*B2</p>
</td>
<td>
<p>500</p>
</td>
<td>
<p>=C2&#43;D2</p>
</td>
</tr>
</tbody>
</table>
<br>
Then you can fill the second row down through row 1001 and get 1000 random samplings.<br>
<br>
Then you can make a chart using the last column to show the distribution.<br>
<br>
EDIT: meh... what DCMonkey said.<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/edd6fe61f219477ba5279deb0168ccfc#edd6fe61f219477ba5279deb0168ccfc</link>
		<pubDate>Thu, 01 Jun 2006 00:27:00 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/edd6fe61f219477ba5279deb0168ccfc#edd6fe61f219477ba5279deb0168ccfc</guid>
		<dc:creator>Maurits</dc:creator>
		<slash:comments>16</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Maurits/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Simulations using Excel</title>
		<description><![CDATA[<p>Hi<br>
<br>
Maurits is closest to what I was trying to describe. However, on the bus route they are many bustops - so they would 10 or more similar lines on the spreadsheet. Each bustops has an upper and lower limit of passengers who might be wanting to board the bus.
 So the simulation will generate different combinations of random numbers of boarding passengers at each bustop.&nbsp;&nbsp;All these different combinations will affect&nbsp; passenger loading times and hence the total travel time over the entire journey.<br>
<br>
I tried to paste a copy ( screen print )&nbsp;of the spreadsheet into this message but I can't do it. Any ideas how ?<br>
<br>
Any other way to&nbsp;send you this information ? You then be able to see why I need some code to run the simulation many times so that a frequency distribution of total bus journey travel time can be plotted.<br>
( Normal frequency distributions are the ones that are normally taught in schools - but it is likely that this bus simulations freq. dist.&nbsp;won't be normal - but that's what I want my student to find out)<br>
<br>
&nbsp;<br>
<br>
Keli<br>
<br>
<br>
PS <br>
How did you make&nbsp;the table, Maurits ?<br>
Is it possible to send file attachments ?<br>
Can we paste images into the messages ?<br>
<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/0b2426c69f984c189af99deb0168cd2b#0b2426c69f984c189af99deb0168cd2b</link>
		<pubDate>Thu, 01 Jun 2006 06:51:41 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/0b2426c69f984c189af99deb0168cd2b#0b2426c69f984c189af99deb0168cd2b</guid>
		<dc:creator>Keli</dc:creator>
		<slash:comments>16</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Keli/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Simulations using Excel</title>
		<description><![CDATA[<p>I still cant see why you cant use what Maurits suggested? <br>
<br>
You could have say 10 samples per bus stop. So you have ten rows, each row calculating the total travel time for a random number of passengers. Then you could average these time to a mean total travel time.<br>
<br>
Then do another 10 rows for the other bustop, and calculate the total times for another 10 random samples.
<br>
<br>
I dont think you can post images into messages. You could up load your Excel file and post a link here.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/835b7db602a2482e94bf9deb0168cd58#835b7db602a2482e94bf9deb0168cd58</link>
		<pubDate>Thu, 01 Jun 2006 08:02:25 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/835b7db602a2482e94bf9deb0168cd58#835b7db602a2482e94bf9deb0168cd58</guid>
		<dc:creator>System</dc:creator>
		<slash:comments>16</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/System/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Simulations using Excel</title>
		<description><![CDATA[<p>I made an attempt at writing VBA code for this problem, available here:</p>
<p><a href="http://paintedblue.panicnow.net/Code/BUS_TEST_SIMULATOR.xls">http://paintedblue.panicnow.net/Code/BUS_TEST_SIMULATOR.xls</a><br>
<br>
Since it uses VBA, you will need to set Excel's security to allow macros to&nbsp;run (in Tools | Options | Security | Macro Security -- setting this value to Medium will prompt you regarding the execution of macros, however you should reset it back to High security
 if you are concerned about the potential for computer virii executing within Excel's context).<br>
<br>
Basically, I have provided a set of cells to configure the test. These cells are currently located in Range J1:N2. You can specify the number of tests to run in addition to the value of the constants.<br>
<br>
To the left of the configuration cells is a command button. Clicking the button will run the test. The data will populate in Columns A through F, although this is configurable in the code.<br>
<br>
To view the VBA code, select Tools | Macro | Visual Basic Editor. The majority of the code resides on the Sheet1 object.<br>
<br>
Finally, it is worth mentioning that I am currently populating the random number of passengers value using a simple VBA random number generator algorithm. However, if you want to use the RANDBETWEEN function, you can uncomment line 55 and comment line 56. I
 chose not to use RANDBETWEEN because it appears to recalculate all cells each time that it is executed, which results in very slow performance. The VBA approach will generate 1000 rows of data in less than one second on my workstation.<br>
<br>
Please let me know if you have any questions!</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/6c98f42c23b742d3950c9deb0168cda2#6c98f42c23b742d3950c9deb0168cda2</link>
		<pubDate>Thu, 01 Jun 2006 21:29:33 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/6c98f42c23b742d3950c9deb0168cda2#6c98f42c23b742d3950c9deb0168cda2</guid>
		<dc:creator>PaintedBlue</dc:creator>
		<slash:comments>16</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PaintedBlue/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Simulations using Excel</title>
		<description><![CDATA[<p><blockquote>
<div>Keli wrote:</div>
<div>How did you make&nbsp;the table, Maurits ?</div>
</blockquote>
<br>
<br>
Since you ask... <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /><br>
I initially made it in Excel.&nbsp; I typed in the formulas with a leading ' which made Excel display them literally.&nbsp; I used Excel's &quot;border&quot; tool to make the border.<br>
<br>
Then I opened up a new message in Outlook 2000.&nbsp; I set the mail format to HTML, and copy/pasted from Excel to the mail message.<br>
<br>
Then I right-clicked the message and &quot;View Source&quot;d.<br>
<br>
Then I copied the HTML from &lt;table&gt; to &lt;/table&gt;.<br>
<br>
Then I went to Channel 9, replied to your post, and switched to the &quot;HTML&quot; tab in the FreeTextBox editor.<br>
<br>
Finally I pasted the HTML I had copied.<br>
<br>
(yuck!)<br>
<br>
To post images... first I got a free Geocities account (www.geocities.com)<br>
I save the image in gif or jpg format and upload it to my account<br>
Then I open the image at the geocities URL in another browser window<br>
Finally I drag and drop the image into the FreeTextBox editor.<br>
<br>
To transfer files, you could .zip the file up and post it on your Geocities account.&nbsp; Then you could post a link in your comment.<br>
<br>
Finally... to add more stops, you could add more columns.&nbsp; The formulae get a little more complicated, but ten stops shouldn't be impossibly difficult.<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/0263d568fcaa45c9a3499deb0168cdd0#0263d568fcaa45c9a3499deb0168cdd0</link>
		<pubDate>Thu, 01 Jun 2006 21:53:53 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/0263d568fcaa45c9a3499deb0168cdd0#0263d568fcaa45c9a3499deb0168cdd0</guid>
		<dc:creator>Maurits</dc:creator>
		<slash:comments>16</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Maurits/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Simulations using Excel</title>
		<description><![CDATA[<p><blockquote>
<div>Maurits wrote:</div>
<div>&#65279;To post images... first I got a free Geocities account (www.geocities.com)<br>
I save the image in gif or jpg format and upload it to my account<br>
Then I open the image at the geocities URL in another browser window<br>
Finally I drag and drop the image into the FreeTextBox editor.<br>
</div>
</blockquote>
<br>
Does that work? I didn't think Geocities allowed external linking to images.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/66938b7f03ca4ac09b3b9deb0168cdfb#66938b7f03ca4ac09b3b9deb0168cdfb</link>
		<pubDate>Thu, 01 Jun 2006 22:03:48 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/66938b7f03ca4ac09b3b9deb0168cdfb#66938b7f03ca4ac09b3b9deb0168cdfb</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>16</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Simulations using Excel</title>
		<description><![CDATA[<p><blockquote>
<div>Sven Groot wrote:</div>
<div>Does that work? I didn't think Geocities allowed external linking to images.</div>
</blockquote>
<br>
<br>
Sure, see <a href="/ShowPost.aspx?PostID=72899#72899">this post</a> for example<br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/4eb0aa7d01b14a60bdba9deb0168ce25#4eb0aa7d01b14a60bdba9deb0168ce25</link>
		<pubDate>Thu, 01 Jun 2006 22:06:53 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/4eb0aa7d01b14a60bdba9deb0168ce25#4eb0aa7d01b14a60bdba9deb0168ce25</guid>
		<dc:creator>Maurits</dc:creator>
		<slash:comments>16</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Maurits/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Simulations using Excel</title>
		<description><![CDATA[<p>Big thanks&nbsp;to&nbsp;y'all for the replies. ( anon, PaintedBlue, Maurits, Sven Groot )<br>
<br>
PaintedBlue - I will look at your file over the weekend and give feedback in a couple of days. And then post more stuff via geocities.<br>
<br>
Have a&nbsp;fab weekend<br>
<br>
Keli</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/37cea5a76934447ebd369deb0168ce50#37cea5a76934447ebd369deb0168ce50</link>
		<pubDate>Sat, 03 Jun 2006 16:26:21 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/37cea5a76934447ebd369deb0168ce50#37cea5a76934447ebd369deb0168ce50</guid>
		<dc:creator>Keli</dc:creator>
		<slash:comments>16</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Keli/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Simulations using Excel</title>
		<description><![CDATA[<p>Hi all,<br>
<br>
I modified PaintedBlue's file - BUS_TEST_SIMULATOR.xls and&nbsp;included a frequency distribution ( Histogram ).<br>
<br>
<strong>Modified - Paintedblue solution</strong><br>
<a href="http://www.geocities.com/keli_mutiso/bus_test_simulator_modified_v2_paintedblue.xls">http://www.geocities.com/keli_mutiso/bus_test_simulator_modified_v2_paintedblue.xls</a><br>
<br>
I left my student to figure out how to modify his solution to achieve a similar output. However you will notice the major differences<br>
<br>
<strong>Student's file - so far<br>
</strong>&nbsp;<a href="http://www.geocities.com/keli_mutiso/simulations_modified_06june06_version1.xls">http://www.geocities.com/keli_mutiso/simulations_modified_06june06_version1.xls</a><br>
<br>
I have left him to try and look at paintedblue solution and see if he can incorporate some extra things. The major difference in between the two solutions&nbsp;is that
<strong>paintedblue's Bus_test_simulator&nbsp;</strong> has one bus stop in the model but my student has several bus stops on route each with different min and max passengers who might want to board the bus.<br>
<br>
ok - thanks again. You have been very helpful - any additional comments from the pros will be taken seriously.&nbsp;&nbsp;Please don't hesistate to post your thoughts on the&nbsp; code and the solution.<br>
<br>
Keli</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/9e069cff5f5f404a8f0e9deb0168ce7e#9e069cff5f5f404a8f0e9deb0168ce7e</link>
		<pubDate>Wed, 07 Jun 2006 06:52:55 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/9e069cff5f5f404a8f0e9deb0168ce7e#9e069cff5f5f404a8f0e9deb0168ce7e</guid>
		<dc:creator>Keli</dc:creator>
		<slash:comments>16</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Keli/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Simulations using Excel</title>
		<description><![CDATA[<p>The student's approach looks good to me. It is a very clean approach to&nbsp;initializing the test conditions and running the simulation.<br>
<br>
The largest difference between the student's version and my code is that I actually write the test cases out to the worksheet as records, but that is not necessary for generating the histogram. I definitely misinterpreted the requirements in this respect.<br>
<br>
With respect to the student's code, adding a DoEvents call in TestRun's For loop&nbsp;will keep Excel from locking up while the tests are running (see my code as an example -- you only need to call it periodically, not for every iteration of the loop). This might
 be useful in case you wanted to watch the histogram Chart evolve over the course of the simulation in realtime (assuming that a Chart is predefined within the workbook), which is actually pretty neat to see.<br>
<br>
For the AllocateFrequencyToTotalTravelTimeClassBins method, I wanted to point out that all of the If statements&nbsp;are currently being executed for each test iteration, but this does not have to be the case.&nbsp;For example, the following:<br>
<br>
If Cells(29, 5) &gt;= 1840 And Cells(29, 5) &lt; 1890 Then<br>
&nbsp;&nbsp;&nbsp;Cells(3, 7) = Cells(3, 7) &#43; 1<br>
End If</p>
<p>If Cells(29, 5) &gt;= 1900 And Cells(29, 5) &lt; 1950 Then<br>
&nbsp;&nbsp;&nbsp;Cells(4, 7) = Cells(4, 7) &#43; 1<br>
End If<br>
<br>
If Cells(29, 5) &gt;= 1960 And Cells(29, 5) &lt; 2010 Then<br>
&nbsp;&nbsp;&nbsp; Cells(5, 7) = Cells(5, 7) &#43; 1<br>
End If<br>
<br>
can be changed to:<br>
<br>
If Cells(29, 5) &gt;= 1840 And Cells(29, 5) &lt; 1890 Then<br>
&nbsp;&nbsp;&nbsp; Cells(3, 7) = Cells(3, 7) &#43; 1<br>
ElseIf Cells(29, 5) &gt;= 1900 And Cells(29, 5) &lt; 1950 Then<br>
&nbsp;&nbsp;&nbsp; Cells(4, 7) = Cells(4, 7) &#43; 1<br>
ElseIf Cells(29, 5) &gt;= 1960 And Cells(29, 5) &lt; 2010 Then<br>
&nbsp;&nbsp;&nbsp; Cells(5, 7) = Cells(5, 7) &#43; 1<br>
End If</p>
<p>This would result in less work being done on each iteration, and it might allow for the simulation to run slightly faster. In general, it is ideal to minimize the amount of work being performed within a loop when possible.<br>
<br>
Finally, I see that the student is writing a constant value to a cell to induce the worksheet to recalculate, thus allowing RANDBETWEEN to generate new values:<br>
<br>
Cells(2, 3) = 10<br>
<br>
The more explicit way to recalculate the worksheet through code is to fire the worksheet's Calculate() event:<br>
<br>
Call Worksheets(&quot;Sheet1&quot;).Calculate<br>
<br>
Certainly, this causes the same result to occur in the end, but it is easier to interpret what the code is doing --&nbsp;the method is named to allow the code to be&nbsp;self-documenting in nature.<br>
<br>
Thanks, and let me know if you have any other questions.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/efd2897878fc4b3ba7ba9deb0168ceb2#efd2897878fc4b3ba7ba9deb0168ceb2</link>
		<pubDate>Thu, 08 Jun 2006 00:10:23 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/efd2897878fc4b3ba7ba9deb0168ceb2#efd2897878fc4b3ba7ba9deb0168ceb2</guid>
		<dc:creator>PaintedBlue</dc:creator>
		<slash:comments>16</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PaintedBlue/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Simulations using Excel</title>
		<description><![CDATA[<p><blockquote>
<div>Maurits wrote:</div>
<div>&#65279;
<blockquote>
<table>
<tbody>
<tr>
<td><img src="/Themes/AlmostGlass/images/icon-quote.gif"></td>
<td><strong>Keli wrote:</strong><i>How did you make&nbsp;the table, Maurits ?</i></td>
</tr>
</tbody>
</table>
</blockquote>
<br>
<br>
Since you ask... <img src="/emoticons/emotion-1.gif" border="0"><br>
I initially made it in Excel.&nbsp; I typed in the formulas with a leading ' which made Excel display them literally.&nbsp; I used Excel's &quot;border&quot; tool to make the border.<br>
<br>
Then I opened up a new message in Outlook 2000.&nbsp; I set the mail format to HTML, and copy/pasted from Excel to the mail message.<br>
<br>
Then I right-clicked the message and &quot;View Source&quot;d.<br>
<br>
Then I copied the HTML from &lt;table&gt; to &lt;/table&gt;.<br>
<br>
Then I went to Channel 9, replied to your post, and switched to the &quot;HTML&quot; tab in the FreeTextBox editor.<br>
<br>
Finally I pasted the HTML I had copied.<br>
<br>
(yuck!)<br>
<br>
To post images... first I got a free Geocities account (www.geocities.com)<br>
I save the image in gif or jpg format and upload it to my account<br>
Then I open the image at the geocities URL in another browser window<br>
Finally I drag and drop the image into the FreeTextBox editor.<br>
<br>
To transfer files, you could .zip the file up and post it on your Geocities account.&nbsp; Then you could post a link in your comment.<br>
<br>
Finally... to add more stops, you could add more columns.&nbsp; The formulae get a little more complicated, but ten stops shouldn't be impossibly difficult.</div>
</blockquote>
<br>
<br>
Somehow I doubt <b>you</b> did those steps Maurits, seems largely unncessary (&quot;sending an email to yourself&quot; says it all) and you know HTML already.<br>
<br>
Here's the (as far as I'm concerned) easier/simpler way of doing it:<br>
<br>
Flip to &quot;HTML&quot; view and type this:<br>
<br>
&lt;table border=&quot;1&quot;&gt;<br>
<br>
That marks the beginning of a table.<br>
<br>
For each row, you type &lt;tr&gt;, followed by &lt;td&gt; for each column in the table. The column's data is contained like so: &lt;td&gt;HERE&lt;/td&gt;<br>
<br>
Once you've finished a row, type &lt;/tr&gt; and move on to the next &lt;tr&gt;<br>
<br>
Once you've finished writing the table, type &lt;/table&gt;<br>
<br>
An example is this:<br>
<br>
&lt;table border=&quot;1&quot;&gt;<br>
&lt;tr&gt;&lt;td&gt;Top Left&lt;/td&gt;&lt;td&gt;Top Right&lt;/td&gt;&lt;/tr&gt;<br>
&lt;tr&gt;&lt;td&gt;Bot Left&lt;/td&gt;&lt;td&gt;Bot Right&lt;/td&gt;&lt;/tr&gt;<br>
&lt;/table&gt;<br>
<br>
Produces:<br>
<br>
<br>
<table>
<tbody>
<tr>
<td>Top Left</td>
<td>Top Right</td>
</tr>
<tr>
<td>Bot Left</td>
<td>Bot Right</td>
</tr>
</tbody>
</table>
<br>
As for the images, in HTML view you type:<br>
<br>
&lt;img src=&quot;%FULL URL TO IMAGE GOES HERE%&quot; /&gt;<br>
<br>
<br>
Quite simple, really <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /><br>
<br>
&lt;img src=&quot;<a href="http://www.forumspile.com/O_RLY-Quite.jpg&quot;">http&#58;&#47;&#47;www.forumspile.com&#47;O_RLY-Quite.jpg&#34;</a> /&gt;<br>
<br>
<br>
<img src="http://www.forumspile.com/O_RLY-Quite.jpg"><br>
<br>
but enough orthoganal posting... sorry I couldn't answer the actual problem at hand, I just felt like nit-picking Maurits' posting <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /><br></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/0de53d189ea84ed291809deb0168cee7#0de53d189ea84ed291809deb0168cee7</link>
		<pubDate>Thu, 08 Jun 2006 00:30:01 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/0de53d189ea84ed291809deb0168cee7#0de53d189ea84ed291809deb0168cee7</guid>
		<dc:creator>W3bbo</dc:creator>
		<slash:comments>16</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/W3bbo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Simulations using Excel</title>
		<description><![CDATA[<p>PaintedBlue are still receiving this thread ?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/56d53c9c29344c0ea3d29deb0168cf11#56d53c9c29344c0ea3d29deb0168cf11</link>
		<pubDate>Wed, 28 Jun 2006 21:06:09 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/194104-Simulations-using-Excel/56d53c9c29344c0ea3d29deb0168cf11#56d53c9c29344c0ea3d29deb0168cf11</guid>
		<dc:creator>Keli</dc:creator>
		<slash:comments>16</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Keli/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>