![]() Setup_HTTP.SetRequestHeader "User-Agent", "Mozilla/4.0 (compatible MSIE 6.0 Windows NT 5.0)"ĭistanceInMiles = Round(Round(WorksheetFunction.FilterXML(Setup_HTTP.ResponseText, _ Output_Url = Initial_Point & First_Location & Ending_Point & Final_Location & Distance_Unit Set Setup_HTTP = CreateObject("MSXML2.ServerXMLHTTP") Public Function DistanceInMiles(First_Location As String, _įinal_Location As String, Target_Value As String)ĭim Initial_Point As String, Ending_Point As String, _ĭistance_Unit As String, Setup_HTTP As Object, Output_Url As Stringĭistance_Unit = "&travelMode=driving&o=xml&key=" & Target_Value & "&distanceUnit=mi" We are creating an User Defined Function to calculate distance in miles. Later, type the following code in the VBA Module.After that, select Insert > Module to open the VBA Module. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |