Lat and Long inputs to Google maps

shal_llly

New Member
Joined
Sep 25, 2017
Messages
8
Hi!

I would like some help where when a user types in the lat and long and clicks on a button, I would like the coordinates to show up in the google maps.

Any help will be appreciated! Thank you very much :)
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Here is one idea


Book1
ABCDE
1PlaceLongitudeLatitudeElevationLink
2Tuvalu-8.54212179.14111View Tuvalu On Google Maps
3Antigua17.0873-61.881211View Antigua On Google Maps
Sheet2
Cell Formulas
RangeFormula
E2=HYPERLINK("https://www.google.co.uk/maps/place/"&A2&"/@"&B2&","&C2&","&D2&"z", "View "&A2&" On Google Maps")
 
Upvote 0
OK, try this

Code:
Sub GotoMaps()
    Dim Lng As Double
    Dim Lat As Double
    Dim Ele As Double
    Dim Loc As String
    
    Lng = Range("B2").Value
    Lat = Range("C2").Value
    Ele = Range("D2").Value
    Loc = Range("A2").Value
    
    ActiveWorkbook.FollowHyperlink _
      Address:="https://www.google.co.uk/maps/place/" & Loc & "/@" & Lng & "," & Lat & "," & Ele & "z", _
      NewWindow:=True
      
End Sub
 
Upvote 0

Forum statistics

Threads
1,216,172
Messages
6,129,290
Members
449,498
Latest member
Lee_ray

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top