Skip to main content

Posts

Showing posts from July, 2010

Zip code Functions for VBA

Haven't posted anything to my blog in a while... so here it goes. I figured that I would contribute some of my code (albeit pretty horrible code) for those who use VBA. I personally don't care much for VBA, but I use it a lot to do some pretty neat stuff in Excel. Anyway... these VBA functions utilize Microsoft's XMLHTTP Object to get some valuable geographic/zip code information. I have provided a few VBA functions. Some of these functions are definitely hacks, as they assume that the USPS website's structure will remain the same. Although, in my opinion, since USPS.com is run by the US government, it probably won't change any time soon. :) Function GetCityState(zipcode As String) This function connects to the USPS.com website to get the city and state abbreviation for the zip code provided. Function GetZipcode(address As String, city As String, stateAbbr As String) As String This function connects the USPS.com website and tries to get the zip code, given ...