Macro/Formula to "Google" search a tab??

mrjaober

Board Regular
Joined
Mar 25, 2004
Messages
58
I have two lists. One lists has a column of general company names. The other list (on a different tab) has specific company names. The two names do not necessarily match. For example, the general name may be ABC Company; the specific company name may be A.B.C. Company Inc.

I want to add a column next to the general company names that has the specific name in it. But doing so manually would take forever. It would be great if there was a macro or formula that would "Google search" the general name and come up with a list of matching specific names.

Does anyone have an idea on how to do this?
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Code:
sub TestMacro()
    Dim rng As Range
    Dim link As String
    Dim page As String
    Dim x As Integer
    x = 0
    link = "http://www.google.com/search?q="
    
    Set rng = Worksheets("Sheet1").Range("H11")  'This is where the list of items you want to make links to starts.
    
    Do While Not IsEmpty(rng.Offset(x, 0))
    
        page = rng.Offset(x, 0).Value
        page = link & page
        rng.Offset(x, 1).Hyperlinks.Add _
            Anchor:=rng.Offset(x, 1), _ 
            Address:=page

        
        x = x + 1
    Loop

end sub
This code starts at the top of a word list and runs down it and puts the link next to it to do a google search until it hits a blank cell.
 
Last edited:
Upvote 0
Code:
sub TestMacro()
    Dim rng As Range
    Dim link As String
    Dim page As String
    Dim x As Integer
    x = 0
    link = "http://www.google.com/search?q="
    
    Set rng = Worksheets("Sheet1").Range("H11")  'This is where the list of items you want to make links to starts.
    
    Do While Not IsEmpty(rng.Offset(x, 0))
    
        page = rng.Offset(x, 0).Value
        page = link & page
        rng.Offset(x, 1).Hyperlinks.Add _
            Anchor:=rng.Offset(x, 1), _ 
            Address:=page

        
        x = x + 1
    Loop

end sub
This code starts at the top of a word list and runs down it and puts the link next to it to do a google search until it hits a blank cell.

That's a nifty trick, but not what I need. I don't actually want to Google the list. I need a function kind of acts like Google.

You know how you can do a Find All search (Cntrl+F) and it gives you a combo box of all the possible matches and their link? I need that. The function would search a list on another tab. After I get the results in a combo box, I can click the correct one and that result would be pasted into the cell.

Thanks for the help!
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,750
Members
452,940
Latest member
rootytrip

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