Free Microsoft Excel 2013 Quick Reference

Excel - Google Maps API Distance Calculator


I have read soo many different threads on making a distance calculator, but I have found that most of them do not work now due to Google changing the HTML on the Maps pages.

I know that there is a way to make the same thing with the Google API (

It can be done by reading the XML and displaying the results within the Steps/Distance/Values tags.

I read about it here:

I have found a copy of one that is on Google Docs where the function need to read XML is readily available here:

But I am still struggling to make a working version that isnt based on Google Docs.

Thanks in advance for all of your help.


Post your answer or comment

comments powered by Disqus

I have a userform which uses the WebBrowser control. The user enters a city and contry to a text box, which then calls google maps to display that area. I have a combo box on this form which list cities as well as a number. Does anyone know how I can link the city list on the google map to the city I have listed in my combo box and have the number associated to that combo box city appear on the google map?


Hello. I have read many threads on this site about using Google Maps to calculate the distance in miles between 2 different post codes. I have copied the relevant code but cannot get it to return anything other than a zero.

I want to return in cell C the value of the distance in miles between the post code in cell A and cell B. Any help would be greatly appreciated.

I have attached the workbook in question.


I have a list of latitude/longitude points and I want to get the driving distance between each of these points. Preferably through the use of some code or macro which automatically generates the driving distance as opposed to the 'as the crow flies' distance.

If this is not possible could you embed a link into Excel which when clicked opens up google maps and calculates the distance between addresses in A1 and A2?

Really appreciate your help.


A shot in the dark, I have tried searching this forum but have not been able to find anything as yet.. but what I am trying to do is:-

I have a Excel list of customer addresses separated into the different address field columns, and then another column with the date that the customer was last visited.

What I want to do is to mark a particular customer address, which should then return me a list of other customers within x miles. I thought maybe this could be done in google maps.

What do you think? Possible??

Hello... I'm looking for a way to have Excel look up and return the driving time and distance for two points using Google Maps. I've seen on this forum and others that it can be done. I'm pretty good with Excel. But, I'm terrible with code. The only solutions I have found while searching involve a lot of code. I'm sure that's probably the answer. But, I would appreciate if someone could spell it out for me or post a file that I could examine. I'm using Excel 2010. Thanks greatly!

A1=Start Address
A2=Destination Address

B1=Driving Time

I've seen it a few places... One was on this forum from a couple years ago:

Google Developer:

And, I know an acquaintance who has done it. Though, he isn't sharing the knowledge. I'm trying to add to a program for the fire department that will aid in planning by showing the driving time and distance from each firehouse to a location. Currently, the spreadsheet I use will return the order of arrival. I have to manually go into Google and look up each station to each geozone centerpoint. This is a large department with 67 fire stations and 550 geozones. I'm hoping to automate the process, rather than do 36,850 separate searches in Google Maps.

Hi, I'm trying to automate a process where post codes in Column A and Column B are entered in to Google Maps and the travel time and distance are recorded in the corresponding cells in Columns C and D. Can anyone assist in creating some code to do this? Thanks.

google maps with excel...

i'm currently fill in mapquest with customer information in Excel..

--this works great...

and now i have a request to do the same idea (street in a10, city in a11, etc.)
with google maps


thank you.

Dear all,

On the internet i've found an excelsheet which integrates google maps with MS Excel (I've added the sheet).
For what i want to do it is almost perfect..almost. When you enter an adress and cityname and click the ''build map'' button your requested city will be found on the map and be marked with a red balloon.
That is just what i need since i need to locate a lot of places. Only thing is that i would like to change the kind of marker that appears (so place one is a red balloon and place two will be a blue balloon, or something like that. In the browser version of google maps it is possible to use different kind of markers and different kind of colours.
The browser version of google maps is not suitable for what i want to do because the city and street names will be generated from other excel tabs in the future. Thats why the google maps integrated into MS Excel is a perfect solution. If i only could change the kind and colour of the markers.
Since im an absolute newbie at MS Excel i dont know how to do this.
I hope you understand what im trying to say and that anyone around here can help me with it!

Thanks in advance,



Short version, it would be very nice if you have all the functions that the browser-version of google maps has (Like changing the type of markers, colours, pulling lines etc.).

Hi guys,

I have recently made a spreadsheet that uses Haversine's Formula to calculate distances between postcode/zipcode for employees at my business. I can do an entire year in 5 minutes for alot of travel. The only problem with this is the formula is an "as the crow flies" measurement and doesn't give a realistic figure between two locations. They are happy with what I have done but for my own personal interest I was wandering if anybody had a working code to return values based on the directions distance calculations.

I have looked around the internet and either find "a theory" to do or an outdated working one with no recent posts and most likely a dead topic. If anybody did have such a thing or could explain in lamens terms how to create one I would be very grateful. I will enclose a moc worksheet of what information I would have and need returned from google. Thankyou in advance for any tips, advice or worksheets you guys can offer.


I want to place a Google Map in an Excel spread sheet... it doesn't need to have any controls, just an object window on the spread sheet that I can embed the HTML copied from Google Maps.

Can anybody give me some direction?


Howdy folks,

Ive Been looking at programming a small VB project intergrating with goodle maps that has a few inputs and will then strip out the Distance required to get to the address and the Time travled.

I cannot see a way with the google map web address formatting to allow having two text boxes (#1 my address, #2 the destination address) then compiling this into a web address that can be outputted into the web browser. when i go this manually it looks to only show the from address.

ill try to give an example
say i live at 127 treeview drive burleigh waters qld to get this up on the map the web addresss would be
though i want to see the distance and time it takes to get to 8 treetop crt burleigh waters qld. when i manually enter the destination address the web addres looks like
so i cannot see how its getting the second address.

It seams all too strange to me so any input would realy help

ps these are not my real address so please dont send all you gifts there as i will not recive them.

This post has a x-post at

Hi, I am new to this forum and hope someone can assist me. I am trying to add a google map link to my excel sheet, but I am having a problem doing so. I know there is a link icon on excel, but cannot make the link. I know the very basics in excel and am not an expert in it, so I am reaching out to the more advanced users for help.

Thanks in advance and I am happy to be a part of this forum.


Hi there,
Here is what I'm trying to accomplish.
Type/paste in a list of city,state,zipcodes into Excel. The first entry will be considered the starting point. Then have a macro access google maps ( & determine the mileage from point A (first entry) to each individual place in the list. From this, we can determine which place is next in sequence for building a route.

The macro would sort the sequence of places in order & then send back to google maps, giving me a route from the starting point to the next closest place to the next & the next.

Does this make sense?
Thanks for the help.

Hi all:

I would like to know if it is possible to extract the address from google maps through excel web query.

I have the link:

I want a vb code that extracts all the 8569 addresses.

Thanks in advance!


I am working on a distance calculator but it's not working quite right.

I have two columns of data, I want to compare cell A1 to every cell in column E that contains data, and input the lowest value into cell B1.

I then want to move to cell A2 and compare this to each cell in Column E and input the lowest value into B2, and so on.

I can do the first part without issues, I cannot then get excel to automate to perform the same function on all the remaining column A cells with data.

I'm trying to figure out if there is a way to write a code so if in column A I have a list of City, State going down 20 or so rows and each being a different location to send this to MapQuest or Google Maps so that it saves each location to a map for viewing. I do this daily with my job on mapquest, but have to go in manually, search, and then save to a map name I have saved under my maps. If this could be done it would save me a ton of time. When finished, I need to be able to look at the map and see the pushpin or bubble for each saved location. I just don't know where to start, but would appreciate any help!


I am wondering if anyone knows how to integrate a compact version of Google Maps (without any navigation bars or options) into Excel?

Basically, I need something like this (only the map portion):

I'd like to be able to display a different location based on an address somewhere in the sheet.

Hi hope you can help in a spreadsheet i use for my account managers one of the columns has the following formula
=IF(F6="",HYPERLINK(""&AK6&"","View Map"),HYPERLINK(""&F6&"","View Map"))

where f6 is a post code . If no postcode in F6 it looks at AK6 for a postcode of the nearest train station identified

This works fine but my account managers prefer google maps to streetmap can any one provide the formula to achieve this

thank you

My purpose here is to have excel calculate distanced between multiple locations and multiple resources. Example: I have 2 workers and 2 jobs. Which worker is closest to what Job. I already have the distance calculator figured out, but I have to do the assignment manually. How do I have excel do that for me?
Please see attached example.

I want to parse the latitude/longitude of a given address in excel, using xmlhttp. I have the following code that does not work. Can anyone help?

Sub Macro1()
'Create the xmlhttp object
Dim xmlhttp
Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
'Open a connection and send a request to the server in the form of an XML fragment
Call xmlhttp.Open("POST", ",Sao+Paulo,Brazil&output=xml&key=entergoogleapikeyhere", False)
Call xmlhttp.send("")
'Create an xml document object, and load the server's response
Dim xmldoc
Set xmldoc = CreateObject("Microsoft.XMLDOM")
xmldoc.async = False
'Note: the ResponseXml property parses the server's response, responsetext doesn't
xmldoc.loadxml (xmlhttp.responsexml)
'Use the server's information to update the spreadsheet
Worksheets("TimeSheet").Range("A1").Value = xmldoc.documentelement.getAttribute("coordinates")
End Sub

the errors in on the xmldoc.loadxml (xmlhttp.responsexml) line
the xml file (if I use response text) follows:

Rua Candido Espinheira 540,Sao Paulo,Brazil
geocodeR. Dr. Cândido Espinheira 540, Barra Funda, São Paulo, 05004-000, BrazilBRSPSão PauloBarra FundaR. Dr. Cândido Espinheira 54005004-000-46.664448,-23.532852,0

I have, of course, my own google maps api key, which I've erased on this post.

Hi guys is it possible for google maps or any other program to autocorrect a spreadsheet of badly formatted street addresses into ones that are formatted and correct?

For example, one bad address might be:

80 riverside dr. ny, ny 20678

The actual address is:

80 Riverside Dr, New York, NY 10024, USA

I have about 5000 entries in my spreadsheet and it would take forever for me to check them manually.

Thanks in advance,

Dear all
I want to know about the creation of file for excel format and api
needed for it.I want to write this program in c++.Is there any msdn
help for it.From where i will get all information.Kindly tell me.

Does anyone know how to email only selected portions (answers) of an excel
spreadsheet, and not the calculation cells also on the same spreadsheet?

how do you export an excel xml map, such that it could be used to send the
worksheet definition/structure (not the data) to other users?

No luck finding an answer? You could always try Google.