PDA

View Full Version : Excel VBA macros - webquery



nagaramesh
07-25-2013, 05:32 AM
Hi,
Please help me with VBA code for:
I need to get latitude/longitude positions for some addresses in US.
I have ADDRESS with ZIP as single input from a cell (A1) in Excel. Now macro has to put that cell value into Website (say google.com)
and populate the output and copy the value back in Excel in
next column same row (B1 cell).
This web query needs to be performed for 1000 number of addresses (A1 to A1000 cells) which are put in a column in excel.
please help me with the code.
Thanks,
Ramesh

nagaramesh
08-07-2013, 04:18 AM
can anyone answer to this question ??

ashleyuk1984
08-17-2013, 05:01 PM
Hi nagaramesh,
Are you still looking for this solution??
I've very recently started to look at VBA and IE integration. I believe your task can be done, let me know if you still require help with it.

nagaramesh
08-18-2013, 11:40 PM
Hi Ashley,

I'm still in search for answer as VBA is lill difficult for me to understand :D



Hi nagaramesh,
Are you still looking for this solution??
I've very recently started to look at VBA and IE integration. I believe your task can be done, let me know if you still require help with it.

ashleyuk1984
08-19-2013, 12:11 AM
I know what you mean :P I'm still learning it myself.
Could you please provide me with a workbook with a few addresses, so I can see the format that they are in. Also, do you have any particular website that you would like me to use in order to obtain the latitude/longitude positions.

nagaramesh
08-19-2013, 01:22 AM
you can take this web : findlatitudeandlongitude.com/batch-geocode

data looks like this:


PROPSTREET
PROPZIP
PROPSTRNBR
PROPCITY
CNTYCDE
STATE


Hwy 630 E
33843
5500
Frostproof
POLK
FL

ashleyuk1984
08-19-2013, 12:01 PM
Hi nagaramesh.
I have coded up the web query. It seems to be working fine.
Unfortunately I couldn't use the website that you suggested, it handles html in a funny way and I wasn't able to extract the data required for some reason.
However, I have found another website which is very similar which I can extract the data from.
Due to the type of query that we are running here, each line takes a second or so to return the correct data, so if you have 1000 lines, then you'll be looking at around 15 - 20 minutes for all the data to complete. Which is pretty good considering it's automated, and no longer manual.

Please could you provide me with some more addresses, in the same format as above so that I can test a bit more before handing you the file & code.
5 more addresses will be OK, I can copy and paste them multiple times. I just need to make sure that the code is handling the query correctly.
Thanks

mancubus
08-19-2013, 12:24 PM
hi.

check this out:
http://www.jpsoftwaretech.com/excel-vba/latitude-longitude-functions/

mancubus
08-19-2013, 01:13 PM
and there is a database available here in csv format:

http://federalgovernmentzipcodes.us/

ashleyuk1984
08-21-2013, 10:57 AM
Do you have more addresses ???

mancubus
08-21-2013, 11:17 AM
i dont have any :)

that site is a result of google search...

ashleyuk1984
08-21-2013, 11:55 AM
Sorry mancubus, I was talking to the op :) I want more addresses so that I can test my vba coding further, before I hand him/her the final product.

mancubus
08-21-2013, 12:11 PM
sorry too, ashleyuk1984.


i thought you were the OP...

i must be tired... :whistle: