Skip to content

Instantly share code, notes, and snippets.

@zkarpinski
Last active March 31, 2018 16:17
Show Gist options
  • Save zkarpinski/9719072 to your computer and use it in GitHub Desktop.
Save zkarpinski/9719072 to your computer and use it in GitHub Desktop.
VBA Script to Google a seleciton of cells within excel
'Microsoft Excel Macros Master Module
'Community collaboration of macros for Microsoft Excel 2010 and 2013.
Attribute VB_Name = "Master_Module"
Public Sub GoogleIt()
'Google searches each item in selection
Attribute GoogleIt.VB_Description = "Google searches each item in selection"
Dim itemList, item As Variant
Dim ie As Object
itemList = Application.Selection
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
For Each item In itemList
ie.Navigate2 "https://www.google.com/search?q=" & item, 4096 '4096 = navOpenInBackgroundTab
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment