-1

On a click on the data in a cell in the excel, the data needs to be copied to a browser & the browser to open.

Example: I have the text "Stackoverflow" in cell A1 in Excel. Upon a click on the cell, the contents should be copied to a desired browser e.g.: google.co.in and the browser should open showing the results.

Community
  • 1
  • 1

3 Answers3

0
Private Sub IE_Autiomation()
Dim IE As Object
For Each cell In Range("A1:A200")
     ' Create InternetExplorer Object
    Set IE = CreateObject("InternetExplorer.Application")
    IE.Visible = False
    ' Set webpage address(google+searching word
    IE.Navigate ("http://www.google.com/?gws_rd=ssl#q=" & cell.Value)
    IE.Visible = True
Next
End Sub

Do you need something like this?

Liniel
  • 719
  • 1
  • 6
  • 15
0

A possible solution is as follows:

  1. Create a new control button
  2. Add the following macro to the button:

    With Worksheets(1)
       .Hyperlinks.Add Anchor:=.Range("A1:B3"), _
           Address:="http://www.google.co.in/search?q=" & ActiveCell.Value
    End With
    
    1. Replace A1:B3 with your range
    2. Go to a cell (use navigation keys on your keyboard or type cell location in the search bow)
    3. With your mouse, click the button you created once
    4. Click the text in the desired cell

I am not claiming that this is the best solution, but it does what is needed, given that one follows the steps outlined above

Dmitry Pavliv
  • 35,333
  • 13
  • 79
  • 80
Shazu
  • 587
  • 3
  • 10
-1

I used this code. Thank you all.

Private Sub CommandButton3_Click()
Dim IE As Object
For Each cell In Range("b7")
     ' Create InternetExplorer Object
    Set IE = CreateObject("InternetExplorer.Application")
    IE.Visible = False
    ' Set webpage address(google+searching word
    IE.Navigate ("http://www.google.co.in/?gws_rd=ssl#q=" & cell.Value)
    IE.Visible = True
Next
End Sub
Hambone
  • 15,600
  • 8
  • 46
  • 69