Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jun 2009
    Location
    Hemet CA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking

    From my worksheet ”Client Info” Is there a way of using VBA to go to Google map quest using internet explorer and entering street address from cell “B12”, City “B13”, State “B14” and Zip “B15. Is this possible

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    See Google Map Parameters for info about the search string Google Map uses.

    Sample code:

    Dim strAddress As String
    ' Assemble string of the form "25 Palm Court, LouisVille, CA 90123"
    strAddress = Range("B12") & ", " & Range("B13") & ", " & Range("B14") & " " & Range("B15")
    ' Replace spaces with +
    strAddress = Replace(strAddress, " ", "+")
    ' Go to Google Maps with search string
    ActiveWorkbook.FollowHyperlink "http://maps.google.com?q=" & strAddress

  3. #3
    3 Star Lounger
    Join Date
    Jun 2009
    Location
    Hemet CA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post

    [quote name='HansV' post='787803' date='06-Aug-2009 12:12']See Google Map Parameters for info about the search string Google Map uses.

    Sample code:

    Dim strAddress As String
    ' Assemble string of the form "25 Palm Court, LouisVille, CA 90123"
    strAddress = Range("B12") & ", " & Range("B13") & ", " & Range("B14") & " " & Range("B15")
    ' Replace spaces with +
    strAddress = Replace(strAddress, " ", "+")
    ' Go to Google Maps with search string
    ActiveWorkbook.FollowHyperlink "http://maps.google.com?q=" & strAddress[/quote]

    Hi HansV
    Thank you Thank you
    You are the man !!!!!!!!!
    That worked awesome

  4. #4
    5 Star Lounger
    Join Date
    Oct 2001
    Location
    San Bernardino, California, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hans, is there a way to do this without the user being able to see the query code (URL)? For example, if I construct a valid Google Maps query but I want the spreadsheet link to simply be a button or a link that simply says "Click here for map" then, when clicked, all the query parameter is passed on correctly.

    I find that some of the links I construct are very long since I put comments in them that display on the map (for example, "park on South side and enter though rear entrance"). Rather than show all this on the spreadsheet, I would like a cleaner link.


    [quote name='HansV' post='787803' date='06-Aug-2009 12:12']See Google Map Parameters for info about the search string Google Map uses.

    Sample code:

    Dim strAddress As String
    ' Assemble string of the form "25 Palm Court, LouisVille, CA 90123"
    strAddress = Range("B12") & ", " & Range("B13") & ", " & Range("B14") & " " & Range("B15")
    ' Replace spaces with +
    strAddress = Replace(strAddress, " ", "+")
    ' Go to Google Maps with search string
    ActiveWorkbook.FollowHyperlink "http://maps.google.com?q=" & strAddress[/quote]

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    This topic was about opening a web page from code, so the user doesn't have to see the URL at all.

    If you create a command button on a worksheet, the caption of the command button can be anything you want.

    If you create a hyperlink in a cell, you can specify a display text, so the user doesn't have to see the URL either.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •