Sunday, December 28, 2008

Bullseye Chart in Excel

The other day I got a $50 Project request from a guy who was analyzing shooting range results -- that's right, guns and stuff. Cool. Anyway...he couldn't figure out a nice, clean way to visually represent the results in scatter plot fashion. He had even started to mess around with various in-cell charting techniques to pull it off.

I decided that Excel's built-in XY scatter plot graph should be able to do the trick, but it took treating each data point as it's own series (so you can use the "shot number" as the data series name and place it in the data point), adding additional data series to "draw" the bullseye and concentric circles, and some other formatting tricks to pull it off. Here's what it looks like:

All in all, not bad, I'd say. Insiders subscribers, your file's on it's way.

Friday, December 26, 2008

Dial / Gauge / Speedometer Chart

Many of you are no doubt aware that this is far from an original concept. Just google "Excel dial chart" or "Excel gauge chart" or "Excel speedometer chart" and you'll see the legions of others before me -- Jon Peltier, Andy Pope, Bill Jelen, to name some major influences on me -- who have done their own versions of this type of chart. Some even have released handy add-ins so that non-power users can easily create these charts for themselves. Nonetheless, I thought it'd be fun to put my own stamp on this type of chart and let my Insiders subscribers play with it. Here's a shot of the chart:

Users will be able to change it's size, scale, start and stop angles, show or hide major and minor gauge marks and add one or two "red zone" regions for the chart, among other features.

Have fun with it.



Sunday, December 14, 2008

Reader's Enhancement to 2008-2009 College Football Bowl Spreadsheet

This is what I love most about the Internet: collaboration with complete strangers.

A couple days ago I got an email from one of my readers, Jonathan Sickinger. Jonathan said that he searched on Google for bowl spreadsheets and found the one I did. (BTW, I saw that I'm the number one hit for a great variety of college bowl pool spreadsheet-related!) Jonathan said that after playing around with the spreadsheet for a few days he decided to make some edits and customizations. Great! He made some cosmetic changes to match an entry form that he sends out to his pool participants. I like the look better than what I had done, personally. Next he added space for up to 40 participants (over my 35).

Then Jonathan said that he had an epiphany: In addition to the individual tracking charts, wouldn't it be great if we also had a chart for each bowl? These charts allow participants to see the pick dispersion for each game, giving them a sense of how important that game is to their overall chances. For example, if everyone in the pool weights the same game as one of their most confident picks then the relative importance of that game drops significantly. Follow? Jonathan also threw in some data on each game to show where the bowl ranks in average points wagered and the distribution of who picked which team. Very cool.

I thought it'd be nice to share with everyone this new and improved version and it's accompanying entry form, so here you go:


Note: the file's a bit heftier now at >2,500 KB vs. the roughly 1,200 KB it was before, but I think the new features are worth the added weight.

Next up? Jonathan and I are thinking about collaborating on a VBA-based enhancement to make it so that once a pool organizer gets everyone's entry forms back, he or she can simply click a button to pull everyone's picks into the master workbook. That'll be sweet, no?



Saturday, December 13, 2008

Pulling Images into Excel from Websites

You may recall a post I did just over a year ago about pulling images into Excel. That project involved pulling images from directories on your computer. I just completed another $50 Project where the client wanted to pull images into Excel from a website. Really the process was the same, except that this client is using Excel 2007, so I had to head Jonah's advice (see comment on that last project's post) and instead of directly pull the images using


I had to first draw an appropriately sized rectangle, move it to the appropriate cell, and "pull the image" by making it the background fill for that rectangle. Maybe someday Microsoft will fix this little idiosyncrasy in Excel 2007, but we'll not hold our breaths.

In the end it's a nice little file. Insiders, your file's on it's way.



Thursday, December 11, 2008

The Lawyer's Guide to Microsoft Excel 2007

I don't know why, but when a lawyer friend of mine sent me this, it struck me as terribly funny.

The Lawyer's Guide to Microsoft® Excel 2007

"Spreadsheet programs are one of the most powerful but underutilized tools in the trial lawyer's toolbox. John Tredennick's concise, clear book shows you how to use spreadsheets powerfully and quickly. I believe that every litigator should be familiar with the contents of this book." -- Joe Kashi, Esq., Author

Maybe it's just this Excel_Geek's frame of mind, but isn't a spreadsheet " of the most powerful but underutilized tools..." in almost any profession's toolbox?

No offense to John Tredennick. I'm a fan of anything and everything Excel, but what's next? One of these specialized titles?

The Rancher's Guide to Microsoft® Excel 2007
The Cab Driver's Guide to Microsoft® Excel 2007
The Hitchhiker's Guide to Microsoft® Excel 2007

Too funny.

Monday, December 08, 2008

2008-2009 College Football Bowl Spreadsheet

Remember that college football bowl pool spreadsheet I did last year (and the year before )?

Well...I guess it's now a holiday season tradition. Here's the same one updated for this season's match-ups. My gift to you.


This year's has been updated so that you can track up to 35 participants, and I've reformatted the individual charts sheet, so that it prints out nicely.

Merry Christmas,


Wednesday, November 12, 2008

Pulling Company Financial Statements from Yahoo Finance

Here's an interesting $50 Project I just completed. The request was for a spreadsheet that would allow the user to enter a stock ticker symbol, and it would go out to the Yahoo Finance website and pull back either the quarterly or annual versions of the income statement, balance sheet, or statement of cash flows for the company. I think I've accomplished that pretty well.

I even did some formatting to make them look similar to those on Yahoo Finance. Here's what the Yahoo Finance version of the Cash Flow statement looks like...

(click on the image above to see a larger version)

And here's the Excel version ...

(click on the image above to see a larger version)

I even did a little "...gathering moment please..." status message while the query is running.

(click on the image above to see a larger version)

This is another example of a web query project that I did where instead of using the CreateObject("MSXML2.ServerXMLHTTP") method, I actually initiate an Internet Explorer session behind the scenes using the CreateObject("InternetExplorer.Application") method. Using this method was preferable for this project, as I was able to identify the table containing the financial statements and pulled the "inner HTML" from it rather than having to use Regular Expressions to tease out each data point.

I thought it was interesting, but being the Excel_Geek, I probably would.

Excel_Geek Insiders subscribers, your file is on its way!



Friday, August 22, 2008

The Amazing Chase is Back!

Hey everyone,

It's that time of year again -- time for the Amazing Chase. This is a super-fun fundraiser, modeled after the television series The Amazing Race, put on by St. Monica's Behvioral Health Services for Women. My team, "Scared Hitless" actually won this last year. Last year we raised over $2,500, which started us in 5th, but we were able to make it up. The competition looks fierce this year, though, so we're gunning for $4,000.

The first leg of the race involves raising money for St. Monica's. The more we raise, the better starting time we get. Here's where you come in. Here's a quick, easy way to support my team. Any little bit you can afford helps. AND, for one lucky donor, I'll throw in a free $50 Project.

Thanks in advance to everyone who helps.



Tuesday, August 12, 2008

Parsing Google Search Results for URLs

I had a visitor on the blog yesterday who was interested in my old Google search results parsing code. Apparently he found Goohackle's Gooparser and liked what it does -- i.e. return just a clean list of URLs from the search results of Google -- but wanted a way around the limit for the number of results and a way to pull them directly into Excel.


I cleaned up the old code for him. The result is a nice, clean worksheet that returns just the URLs from Google search results pages. You can set how many results per page and pages you'd like to return. Be careful, though, as if you hit Google too many times too quickly, they'll start to block you, asking you for your API key, etc. I've built in a random pause (3 to 7 seconds) between the pages in a multi-page query in an effort to prevent this from happening, but no guarantees. Google is a pretty sophisticated outfit, so they may still be able to detect an automated harvesting of data without using the API.

Geoff, enjoy the file. Insiders, the file's on the way.



Sunday, August 10, 2008

Updated UPC Barcode Generator

Remember back when I told you about a $50 Project where I created a handy little UPC barcode generator in Excel? I noticed after that post I receive a meaningful amount of traffic from search engines based on phrases like "barcode generator" and the like. I kept wondering who those people were. Well, not that long ago I found out who at least one of them is: a guy named Ian.

Ian contacted me and wanted me to tweak the barcode generator I had built to suit his needs. Instead of generating one UPC barcode image at a time that he could copy-paste as he needs, he wanted to be able to generate long lists of UPC barcode images and save them as .JPEG files, so that he could later use a mail merge type function to pull them into documents as he needed. Sweet idea. Seemed pretty straightforward...

Turns out that getting those images I created using the little known camera feature in Excel exported to .JPEG files is not so simple. What I ended up doing is creating on the fly what is essentially a blank chart object and them filling it with the image, then exporting the chart as an image using the Chart.Export function in VBA. Whew. Here's a screen shot:

(Click the image to see a larger version.)

For a long list (hundreds or thousands of UPC codes) the process can take some time to complete, so I also threw in a little feature I've been doing when run times last more than a few seconds -- a little progress bar screen. It's essentially another normally hidden tab in the file that appears during run time to show the user how far along they are. Looks cool, too, I don't mind saying:

(Click the image to see a larger version.)

Ian, hope the file's everything you were hoping for.

Excel_Geek Insiders, your copy of the file's on it's way.



Friday, May 23, 2008

Testing the new Twitterfeed.

Oooooo...I'm gettin' all fancy now, I guess. Just another venue for my followers to received updates. Also, I think I might have a solution, now, for a past client looking for a way to regularly update his followers via email. Here's what I mean.



Sunday, March 16, 2008

2008 March Madness NCAA Basketball Bracket

Selection Sunday is over. I've updated my handy little bracket spreadsheet with the selected teams. Those who'd like to download and use it, here's the drill:

  1. Click here to send me $3.00 via PayPal.
  2. Once you've made the payment, you should land back on a page to download the file. If for some reason that doesn't work properly, click here to download the file.
  3. Open the file, making sure you can enable the macros -- that is, your Macro security is set to Medium at highest (Tools --> Macros --> Macro Security). Take note of the "lock code" it gives you.
  4. Email me your lock code, and I'll send you back an associated "key code" that unlocks the file for your use. This code is specific to you and the computer you are using. If you want to use the file on numerous computers, let me know, and I'll see if I can accommodate you.

Good luck with your picks!

Excel_Geek Insiders, if you'd like to use the file, simply download it, and email me your "lock code", I'll send you the "key code" as part of your subscription.



Wednesday, February 27, 2008

Prepopulating a Userform

Just recently I banged out a quick little example for a reader who wanted to know how to quickly and easily store values from a userform created using VBA, and then prepopulate the userform the next time it's brought up with those stored values. Basically, I created a new worksheet in the file that would remain hidden and had a named ranged in that worksheet for each field in the userform. Then, when the userform was called up, I grabbed the values from those named ranges and put them in the inputs in the form. Then, when the userform was submitted, I changed the values in those named ranges to those currently in the userform. Pretty slick.

Like so many things Excel+VBA, it's easy when you know how. I thought my Excel_Geek Insiders would appreciate this simple example.



(how about that, three posts in one day after two months with nothing...can you tell I've been busy?)

A Way Around Web Query Limitations

The other day I got another request for a project that involved pulling data from a website into a spreadsheet. It was a situation where data needed to be posted to a form on the web page to get to the data that was desired. In this case, the user needed to post a start date and end date to the form to return a table of data the he wanted to pull into the spreadsheet. It was a situation that on many web pages would have been super easy using Excel's built-in web query tool and the little known ".posttext" property.

However, due to the way in which this page was built this method wasn't working. A web developer friend speculated it was due to the fact that the page was built using ASP.NET, which complicates a simple form with all kinds of behind the scenes javascript. I couldn't even get the form to post using the POST method of the MSXML.ServerXMLHTTP object (see this old post).

In the end, what I had to do was actually invoke an Internet Explorer session using the "InternetExplorer.Application" object. Once the session was created and I programatically navigated to the desired URL, I was able to identify inputs in the form by ID and put the data needed into each one, then programatically "click" the submit button on the form. Once the new page with the data table loaded, I could select the table of data again by ID, and go through each row and column in the table and pull the data into the spreadsheet. This was actually slicker than if I used my old MSXML.ServerXMLHTTP object method and used Regular Expressions to parse out the data.

This was a fun little learning experience, and I hope you Excel_Geek Insiders enjoy this code. It can be very helpful.



Conditional Indenting

I recently did a quick $50 Project for a long-time client who wanted a certain spreadsheet to have the feature where if there was any value in column B, the formatting of column A in the same row would be indented by 1. Since the built-in conditional formatting cannot do this, it took a few lines of VBA.

Simple and straightforward.

Enjoy the file, Excel_Geek Insiders.