• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro NEED Remake- search in google and copy link

Mateusz

New Member
Here is the macro which :
Search a keyword from selected cell
copy first resualt of searching URL
paste it in the same cell where WAS the keyword.

What do I want it to do:

Search in "google Images" a keyword from one, specific Cell (Address already given)
open firstresualt of searching in max Size of the image
copy the URL
Paste into cell Range("F2")

Here is the code

select_all_icon.jpg
page_white_copy.png

Code:
Sub DZIALAJCEZIEALBOJUZCHROME()
Dim ie As Object
Dim I As Long
Set ie = CreateObject("InternetExplorer.Application")

With ie
.Visible = True 'Just for our test
.navigate "https://www.google.com/search?site=imghp&tbm=isch&source=hp&biw=1920&bih=858&q=" & Worksheets("Arkusz3").Range("A2").Text & Worksheets("Arkusz3").Range("Z2").Text
Do While .ReadyState <> 4: DoEvents: Loop
Do While .Busy: DoEvents: Loop

With .Document
For I = 0 To .Links.Length - 1
If InStrB(1, .Links(I).InnerText, "A80147200") Then
ie.navigate .Links(I).href
Do While ie.ReadyState <> 4: DoEvents: Loop
Do While ie.Busy: DoEvents: Loop
MsgBox .URL
Exit For
End If
Next I
End With

End With

Set ie = Nothing
End Sub
 
Last edited by a moderator:
Mateusz

Can you upload the whole file as without the data in : Arkusz3
it's a bit hard to know what is wrong
 
Hi dude,

I have tried your code, error finding in line no 7. I have uploaded that screenshot, please find that screenshot and please let me know the solution. I am new in macro, please explain me details what to do.

what I did I opened a excel file and I pasted your code and I changed the sheet name, then I ran the code. If it is not correct then please let me know.
Thanks
Murali
 

Attachments

  • error.xlsx
    77.7 KB · Views: 1
Last edited:
Sub DZIALAJCEZIEALBOJUZCHROME2()

This is the macro

which I want to save Image URL froom searching resaults


Or this one
Sub Znajdz_grafike()

Both of them unfortunetly do not work
 

Attachments

  • Final_Almost.xlsm
    520.5 KB · Views: 6
  • Final_Almost.xlsm
    520.5 KB · Views: 3
Back
Top