Start Excel database updating

Excel database updating

Excel doesn't have a Hotdog Drawing tool, but it does have a basic Drawing facility and so a straight line will suffice as a hotdog.

But once I started I couldn't help myself and added the history and cumulative Pi value and variance from Pi as charts.

I also colored the hotdogs according to there location Red for Hotdogs that Crossed a grid line and Green Hotdogs for those that missed a gridline. Calculate Pi Of course this could all be done in memory. Displaying them will definitely slow down the process. Excel uses an orthogonal grid starting at 0,0 at the Top Left corner of the A1 Cell.

Recently I started teaching my 10 year old son about Pi, its relationship to Circles, how and what Pi can be used for and some methods to determine its value. Cells(cross, 2) = i Hotdog Color = RGB(255, 0, 0) 'Red Worksheets("Results"). Draw the Hotdog Once the code has determined if the Hotdog is a Red(Crosses a gridline) or Green (Is between the gridlines) we can draw the hotdog.

During this I stumbled on an article about How to calculate Pi by Throwing Frozen Hotdogs. This is more correctly known as the Buffon's Needle. The drawing is outsourced to a small subroutine to simplify the code flow.

Pi is then estimated as the Total number of Hotdogs /Number of Hotdogs that cross a grid line/2.

In Excel, I originally thought of using a chart, but adding new series to a chart requires VBA.

I also wanted to be able to throw many thousands of hotdogs and most chart types have a limit of 255 series, although the number of points can be much greater than 255.

I also needed the ability to rotate each hotdog individually.

This allows for space above/below for inputs, controls and stats. But in Excel 2010 using a standard Calibri Font, I could only get an odd 49.5 pts Row Spacing (66 pixels).

Close enough and I can use that as a variable in VBA when I check the hotdogs location, more on this later.

Cells(i 1, 6) = -10 same = same 1 Else Worksheets("Results").