With DataNitro, you can make Excel macros using the Python instead of VBA. Python is really powerful! Here’s how I created a “facebook_likes” function in less than 10 lines of code.
This should take about 5 minutes. Yes, really.
It’s free and you can find it on http://www.datanitro.com
Once it’s installed, you should have a DataNitro tab in Excel that looks like this:
Left click on this link (it will automatically download for you):
Down one column, I setup some URLs like this:
Go to your Downloads folder, and select the functions.py file that you just downloaded and click Open.
To use it, just start typing in “=facebook_likes” into one of the cells.
When you start typing, you should see it comes up with the rest of the functions. Cool!
I typed in “=facebook_likes(B4)” to get the facebook likes for Seerinteractive.com. Here’s an example before I hit enter:
Then I hit enter and BOOM!
Here’s what my completed spreadsheet looks like after I dragged the formula down the sheet:
Oh, and this is my first Python program. Ever. I skipped right over hello world. 🙂
Check out the Github repository: https://github.com/seerinteractive/facebook-likes-for-datanitro
For those who are interested, this was done in under 10 lines of code. Really, that’s awesome for Excel. I can’t imagine what it might have looked like doing this in VBA.
If you want to learn more, go to the DataNitro site and look at the documentation and examples. Python can do a lot of nifty stuff too. Lots of stuff to read in the Python Standard Library: http://docs.python.org/library/