Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CAM CAM is offline
external usenet poster
 
Posts: 65
Default Input distanct from a map into excel

Hello,

I have a user who goes into the Internet using Bing map or Google map to get
sales person driving miles from point A to point B then input the mileage in
Excel 2007 expense report for reimbursement. The problem is there are many
salespersons and each individual sales person travels to many different
places. This is very time comsuming. What I like to is have the user input
in a cell(s) FROM - The address, City, State, Zip in another cell(s) the
TO - Address, City, State, Zip. and in another cell will display the
distance. I am justing wandering if there any add-in or a way to do this.
Any help, tips will be appreciated. Thank you in advance.

Regards

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Input distanct from a map into excel


This macro uses google map to get the driving distance and time between
2 zipcodes. It should get you started. Let me know if you need more
help. I've done this with almost all map utilities including people in
England which uses Postal codes. I also can extract the GPS Longitude
and Latitude from the maps.



Sub FindDistance()

Const READYSTATE_COMPLETE = 4

URL = "http://maps.google.com/maps?hl=en&tab=wl"

Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True


ie.Navigate URL

Do While ie.readystate < 4 Or ie.busy = True
DoEvents
Loop

Set StartLocation = ie.document.getelementbyid("d_d")

StartLocation.innertext = "07508"

Set EndLocation = ie.document.getelementbyid("d_daddr")
EndLocation.innertext = "10001"

Set submit = ie.document.getelementbyid("d_sub")
'submit.Select
submit.form.submit

Do While ie.readystate < 4 Or ie.busy = True
DoEvents
Loop

Call Dump(ie.document)

Set distance = ie.document.getelementbyid("dditd")
MsgBox (distance.innertext)


Set ie = Nothing

End Sub


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=185400

Excel Live Chat

  #3   Report Post  
Posted to microsoft.public.excel.programming
CAM CAM is offline
external usenet poster
 
Posts: 65
Default Input distanct from a map into excel

Thanks Joel I did some modification and woks great. Again I appreciate your
help.

Regards,


"joel" wrote in message
...

This macro uses google map to get the driving distance and time between
2 zipcodes. It should get you started. Let me know if you need more
help. I've done this with almost all map utilities including people in
England which uses Postal codes. I also can extract the GPS Longitude
and Latitude from the maps.



Sub FindDistance()

Const READYSTATE_COMPLETE = 4

URL = "http://maps.google.com/maps?hl=en&tab=wl"

Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True


ie.Navigate URL

Do While ie.readystate < 4 Or ie.busy = True
DoEvents
Loop

Set StartLocation = ie.document.getelementbyid("d_d")

StartLocation.innertext = "07508"

Set EndLocation = ie.document.getelementbyid("d_daddr")
EndLocation.innertext = "10001"

Set submit = ie.document.getelementbyid("d_sub")
'submit.Select
submit.form.submit

Do While ie.readystate < 4 Or ie.busy = True
DoEvents
Loop

Call Dump(ie.document)

Set distance = ie.document.getelementbyid("dditd")
MsgBox (distance.innertext)


Set ie = Nothing

End Sub


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=185400

Excel Live Chat


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
input in number form is being multiplied by 1000 when i input. jweinograd Excel Discussion (Misc queries) 4 April 16th 07 11:18 PM
Have user input converted to uppercase in same cell as input? Shannonn New Users to Excel 1 June 20th 06 03:19 AM
How do I add input data in the input ranges in drop down boxes. oil_driller Excel Discussion (Misc queries) 1 November 9th 05 10:31 PM
=SUMIF(Input!H2:H718,AZ19,Input!E2:E685)AND(IF ALex Excel Worksheet Functions 2 March 14th 05 09:19 PM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM


All times are GMT +1. The time now is 07:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"