Category Archives: Games

Excel Fortune Cookie (…in bed?)

image

Here’s a fun little fortune cookie program. The fortunes are generated from a list of random words. I developed four different grammars for the fortunes, which you can find in the backend data. (Is “grammars” the right word? I’m not sure.) Some of the fortunes, like the one above, seem to make sense. Here are a few I’ve captured, which appear thoughtful and humorous, perhaps even poetic.

  • The ugliest way finds evil.
  • If you satisfy this empty girl generously, you are the one who … does it even matter?.
  • Who wants the answer to be 42? The mammoth formula does!
  • Who finds true love? The beautiful water does!
  • The easy government gives up now.
  • Want the story now? Reluctantly face your family.

Most fortunes, however, come out as nonsense. For example:

  • Want the head now? Frenetically melt the day.

That’s great advice.

Feeling lucky? You should.

Fortune Cookie.xlsx (If the file doesn’t download immediately from Google drive, press the black down arrow in the upper left of the screen, under the menu.)

CUBE: The Rollover Method Returns! Spin a cube in a 3d environment with your mouse!

Ok, so I know I promised no more updates, but this one is too cool. Basically, I combined Andy Pope’s 3d rotation tutorial with the rollover method. The result is a free-floating cube which you can rotate by passing your mouse over it. Here’s a choppy-ish video of what’s going on. I promise however that it run smoothly on your computer. The choppiness is a result of the video’s frame rate.

The mechanism is similar the the election map and the details-on-demand graphs: the chart is placed on top of the hot spots to get the mouse’s coordinates. In this case, the rollover pulls in the mouse’s location and initiates a timer. The timer adjusts the rotation angles based on the mouse’s location. Additionally, some fancy calculations in the timer process procedure give the rotation a “slowing down” effect. I urge you to open on the Visual Basic Editor and do some dissection, if you desire. Remember though, the Timer API is a bit finicky. Make sure to save often in case your Excel crashes while in the middle of your investigations.

The download file: Rotate Cube Rollover.xlsm

Have fun.

Interactive Periodic Table of Elements in Excel

I’ve been on a real rollover kick lately. I’m really trying to figure out if it can be useful. Earlier today I started making a Periodic Table of Elements using Excel. I employed the rollover technique to allow the user to gain information about an element simply by rolling over a cell. Well, for some reason, I couldn’t stop there. So what was meant to be a small project ballooned into something larger. Unfortunately, my sticking to good coding practice didn’t keep up with craving to do more. So what I present to you below isn’t really a polished product. If you poke through the named ranges and the rollover indexes, you’ll probably see that I add and subtract one to them somewhat randomly (a cheap trick – this is  due to my trying to reconcile the table copied from Wikipedia with my indices).

As you can see below (sorry for the graininess of the recorder–be sure to download it to get the full effect), you can not only gain information about an element but you can also toggle on and off different element groupings.

periodic2

If you want to “crack” the file, the first thing you’ll need to do is reset the ScrollArea (Click on a cell. Go to the Developer tab, click Properties. Delete the reference in the ScrollArea box.). Then just unhide everything.

Good luck.
Periodic Table.xlsm

Update –
Reader Dario found an error in the spreadsheet (see the comments) – this is the result of some carelessness and cheap tricks on my part. An updated version will be released tonight. In the meantime however, you can still poke around the file :).

Another Update –
I’ve since fixed the bug described in the reader comments. If you find anything else, let me know!

Turn an Excel Spreadsheet into a Bitmap Image

So I’ve created a spreadsheet program that will import a selected bitmap and use Excel as a canvas to display it.  Each cell is a pixel.  Here’s a picture of president Obama in 8-bit glory:

And here’s my current March Madness bracket in stunning 24-bit:

You can download the file below, and instructions are included on the Instructions tab.  Don’t worry, it’s not hard to use.  If you can use MSPAINT, you’ll be making your very own Excel art in no time!

For now, the code is locked, but I might make it available later after I’m sure it’s error free. Speaking of which, there are a few problems you may (but hopefully won’t) run into:

1.  The picture shows up discolored and slanted.  While I’m fairly certain that I’ve fixed this issue, I admit that I am by no means perfect.  When bitmaps are saved, they are “padded” in the file to make their height evenly divisible by four.  The program should compensate for this padding, but if it doesn’t — again, I’m fairly certain this issue is resolved — just resize the bitmap it to the nearest number evenly divisible by four.  (That number is at most three digits away.)

2.  Too many Different Cell Formats error.  Sometimes you’ll get this annoying popup.  If that happens, try zooming in on the canvas screen first and then reuploading your file.  If that doesn’t work, either crop the original image or resize to a smaller one.  Or, if you are uploading a 24-bit bitmap, consider resaving as an 8-bit and then reuploading.

If you find other issues, please, let me know.  It would be great help.

Also, this is best used with Excel 2007 and above.  It will work in 2003, but remember that 2003 has a column size limitation, which may cause in an error for files that are too large.  If you are concerned, smaller is better: resize or choose to save in the 8-bit format.  When you are done, remember to save as in the Excel 2007 file type (check to see if you are in compatibility mode) so that you get all the columns required to display your most productive spreadsheet, ever.

I’m releasing this now because I’ve been sitting on it for way, way too long.  I was hoping I’d come up with some real, professional use for it, but I haven’t thought of anything yet.  For a moment, I was trying to apply a Hough Transform to the bitmaps to see if I could take images and turn them into cool free form shape, but this proved too taxing for Excel.  I also made an attempt at Eigenfaces which ended ridiculously.  So if anyone out there has some good ideas, please email me and we’ll work together.

Lastly, if you like what you see and choose to host a spreadsheet made with this program (or screen capture of one) on your blog or website, I’d be so grateful if you mentioned this blog!  Have fun.

File
Bitmap to Excel.xlsm