Google search from xl

  • This maybe old hat, but, I just discovered it and I think it's the coolest.


    Code
    Private Sub CommandButton1_Click()
        Dim Srch
        Srch = InputBox("What would you like to search for?", "Internet Search Tool", ActiveCell.Value)
        ActiveWorkbook.FollowHyperlink Address:="http://www.google.com/search?hl=en&q=" & Srch, NewWindow:=True
    End Sub


    By placing a command button on your sheet this will access the internet/google in a seperate window and search for the chosen cell value or anything else placed in the input box.


    I also did one for mapquest that maps an address placed in a sheet automatically. If anyone is interested in that one, let me know and I'll start a new thread with that one.


    Phil

  • Re: Google search from xl


    Hi Phil


    If it's possible, I would be interested very much in your "mapquest" feature.
    How it works? Is it applicable for Hungarian adresses also?


    If you could send a bit detailed information about it I would be very appreciated.


    thank you,
    best regards,
    uandras

  • Re: Google search from xl


    Hi unandras,


    I'd be happy to post something on the mapquest hyperlink and discribe it's details.


    I'll start a new thread in this section so it can have it's own search specs within the site.


    Quote

    Is it applicable for Hungarian adresses also?


    Well I just looked up a map on Budapest and ended up with a very detailed map of the city. In fact it appears that mapquest is very international.


    Now, that means the HTTP address string will change but I think I'll be able to instruct through that.


    Good luck.


    Phil

  • Re: Google search from xl


    This could be quite primitive a question. How does one embed the Google search code (most useful I would add) within Excel?


    A neophyte thanks you.

  • Re: Google search from xl


    There are no "primitive questions" :)


    Quote

    By placing a command button on your sheet this will access the internet/google in a seperate window and search for the chosen cell value or anything else placed in the input box.


    So, from the Controls Toolbox (you may need to activate this from the menu Tools|Customise), add a Command Button to your sheet.
    Then, right click the sheet name tab & select View Code


    Paste Phil's code in the Sheet Code Module.


    You will then need to deactivate design mode & the button, when pressed, will fire Phil's code...

  • Re: Google search from xl


    I'm trying to do something similar with Google's Satellite Maps. If I get it working, I'll post it.


    Stan

  • Re: Google search from xl


    Excellent bit of work there i was interested in the Map feature you were on about so i played with your original code(I say played, meerly cut a pasted a bit!) and came up with this........



    Code
    Dim Srch
        Srch = InputBox("What would you like to search for?", "Map search tool", ActiveCell.Value)
        ActiveWorkbook.FollowHyperlink Address:="http://www.maps.google.co.uk/maps?oi=eu_map&q=" & Srch, NewWindow:=True


    As you can see it uses the english site, but if you change the address accordingly (google.com etc) it still seems to work.


    I know its not as in depth as the Map lookup you have on the other post, but for use within one country it seems all I will ever need!



    Once again thanks for an excellent Tip!

  • Re: Google search from xl


    hi,
    I tried the code from Phil and modified NewWindow:=False. However, it keeps firing up a new IE window everytime. I have set my default browser to Firefox. I will like to keep to Firefox. How can tis be done?
    Many thanks!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!