Displaying multiple addresses in an embedded Google Maps

Devan6410

New Member
Joined
May 2, 2021
Messages
2
Office Version
  1. 365
  2. 2016
Hi Everyone,
I have list of addresses less than 30. I need to show marker for these addresses in google map which i created via Excel Web browser.
Currently im only able to plot 1 address on the map using VBA Code.

No clue how to add more than 1 address on to the google map.

Can someone pls share VBA code for multiple addresses.

Thank you.
Br,
Devan
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Currently im only able to plot 1 address on the map using VBA Code.
Please post your code if you want help with it.

This thread might help, though it plots markers using latitude and longitude co-ordinates so you'll probably need to geocode your addresses using the Google Maps API.

 
Upvote 0
Please post your code if you want help with it.

This thread might help, though it plots markers using latitude and longitude co-ordinates so you'll probably need to geocode your addresses using the Google Maps API.


Hi John,
Please find below the code. With this im only able to show 1 marker on the Google Map in Excel.
In total i need to show 8 marker with the respective GPS coordinates.

I have attached the image as well.
Thank you for your support.

VBA Code:
Private Function CreateLink(Address As String) As String
    
        CreateLink = "https://www.google.com/maps/place/" & Address
        
End Function

Private Sub CommandButtonMapGoogle_Click()

WebBrowser1.Navigate2 CreateLink(ActiveSheet.Range("l3").Value)

End Sub

Photo Excel.png
 
Upvote 0
I see you're using latitude and longitude in columns A:B, so the code in the link should work for you. You'll need to register your application in the Google Cloud Platform, obtain an API key to put in the HTML code and enable the Google Maps JavaScript API. To display the map in your WebBrowser object, instead of the default web browser, you'll need to change this line:
VBA Code:
    ActiveWorkbook.FollowHyperlink Address:=FileName, NewWindow:=True
to something like:
VBA Code:
WebBrowser1.Navigate2 FileName/CODE]
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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