Hello! I am new to VBA, and I am having a hard time figuring out how to move forward with this code that I am working on. I have excel set up to create a custom search URL based on what I am looking for, and I have that in cell(2,2). I have my code set up to use that search URL, but I can't figure out how to pull the links I need (they are all tagged with "href" in the HTML code) and put them in a column back in my excel sheet. Below is my code thus far, any suggestions?
Sub youtubesearch()
Dim myitem As String, myie As Object, myloop As Object, myelement As Object
myitem = Range("c2").Value
Set myie = CreateObject("internetexplorer.application")
myie.navigate Cells(2, 2)
While myie.busy = True
Wend
Set myelements = myie.document.getelementsbytagname("href")
For Each myloop In myelements
If myloop.Name = "q" Then: myloop.Value = myitem
If myloop.Value = "search" Then: myloop.Click: Exit For
Next myloop
myie.Visible = True
End Sub
Bookmarks