Well, this code (function) is based on a data structure created within a workbook.
The data is stored in a named range called urlForDistance
The function returns 2 element array (vector) containing distance and time.
This result in a full code (you have shown just one, most important function) is used in some other function or procedure to show the result.
But you wrote just "another site" :-( not giving it's name or link to it. So I'll not analyze it further, but with 3 small changes I'll make an UDF returning a number out of it (you could say it's 4 changes, but change 1a could be ommitted - it just ensures recalculation).
UDF can be used as any built in function, so if you have say Brisbane in A1 and Adelaide in B1 in C1 you could write:
The code is:
PS. As you can see in change2 I made it "Australia specific" and limited just to city centers.
Bookmarks