ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Web lookup query (have: city+state | want: zip code) (https://www.excelbanter.com/excel-discussion-misc-queries/260879-web-lookup-query-have-city-state-%7C-want-zip-code.html)

avatarr

Web lookup query (have: city+state | want: zip code)
 
I have a spreadsheet with various building information but it only has city and state. I was able to create a .qry file to get external data from a particular location, but it just pulls all the info - I just want to pull out the first zip (it doesn't have to be exactly correct). The idea is that I will then use a zip code to MSA (metropolitan statistical area) lookup table.

I have:
City & State

I want to query for:
The a zip code in said city and state

The contents of the .qry file:
Code:

WEB
1
http://zipcodes.addresses.com/results.php?ReportType=42&qc=["City","Enter the Search Term:"]&qi=0&qk=100&qs=["State","Enter the Search Term:"]

Selection=10
Formatting=None
ConsecutiveDelimitersAsOne=True
SingleBlockTextImport=True

I played with the "Selection =" and "SingleBlockTextImport=" with no success. Available documentation for the parameters & flags for such a query is sporadic at best.

This is what I'm getting after using the above query method:

Click for full size - Uploaded with plasq's Skitch

What I really want is just the 92801 returned.

All help is greatly appreciated. Have a good day.


All times are GMT +1. The time now is 09:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com