Great code and works like a charm, but I noticed couple of issues when I use the logics:
1. after I close excel and re-open the same excel, and copy the formula to the next row I get an error message stating “#NAME?”
2. When the logic calculates the distance for certain addresses, I get values that don’t really make sense. eg. Distance between S. Green St. 60426 and S. Halsted 60425 in excel states 281.2 miles while google maps state approximately 7 miles.
Is this due to reaching my daily quota of 2500 queries or is there something I am missing that I need to include in the VBA script?
I am a novice to VBA scripting, so trying to understand the driver behind this issue. Any help would be greatly appreciated.
Gaurav try to debug the code at the moment when the URL is generate then copy paste this URL to your web browser to see the Google API response. In some cases Google has trouble understanding or mapping the address. Do read Google recommended documentation on how to specify the addresses
Here is an example Google API URL you can use (simply modify the URL with your addresses to see how Google understands your addresses):
Example Distance matrix url