VBA/EXCEL-How to find distance between coordinates when having the list of latitude and longitude coordinates [Solved]

1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 4.75 out of 5)
Loading...
Go back to All Questions Login or Register
Solved301 views
0

Hello!
I was looking at a tutorial on calculating distance between two coordinates. Link attached below. http://analystcave.com/excel-calculate-distances-between-addresses/#Calculate_distance_between_two_coordinates

In my case, i have the list of coordinates of latitudes and longitudes on spreadsheet (for about 59 stations). My ultimate goal is to find the roadway distance (mileage) and traveling time between all of the coordinates. I was hoping to do it by just using the VBA function without google API. Is this something possible?
How should i go about determining the duration using vba function?

Would appreciate if someone could help on this!

0

Hi Mahli,

nope. Not possible without some Web API. You need to either use Google API or Bing API (or whatever the Microsoft version is called). Another option is to scrape some other website but not really and reason to do this.

Google API is free for first 25k queries and afterwards still cheap for every next query.

In my example you can get the duration and distance (driving etc.).

The only example where you don’t need an Web API is if you want to measure crow distance (“straight” line between places). Here is the link:
http://analystcave.com/excel-calculate-distances-between-addresses/#Calculate_distance_between_two_coordinates

Simply the best place to learn VBA!