cell with zip only hyperlink to google maps

Cattle

New Member
Joined
Sep 30, 2020
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I have a column in excel with all the zip codes in Missouri. I want to hyperlink the individual cells to that zip codes location in google maps. Each time I do an internet search I get how to create a map in excel. That is not what I want to do. Any help appreciated.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Try this code:
VBA Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
myZipCol = 2        '<<<The column with Zip codes; 1=A, 2=B, ...
If Not Application.Intersect(Target, Columns(myZipCol)) Is Nothing Then
    ThisWorkbook.FollowHyperlink ("https://maps.google.com/?q=Zip " & Target.Value & " usa")
    Cancel = True
End If
End Sub
You need to copy it to the vba module that belongs to the worksheet:
-rightclick the tab with the name of your worksheet; chose Display code (this will open the macro editor at the right position)
-copy the given code and paste it to the empty right frame of the macro editor
-edit the line marked <<< according your situation

Then return to the worksheet and doubleclick a cell with a zip code.
It will work even if you doubleclick on a cell that contains anything, but the searched site will be an "approximate search" if it isn't a zip code

Bye
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,691
Members
448,978
Latest member
rrauni

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