jamescooper
Well-known Member
- Joined
- Sep 8, 2014
- Messages
- 840
Hello, the following code successfully pulls all the URL links from a webpage and puts them in a listbox; how do I modify to put in column A for example?
Thanks.
Thanks.
Code:
Sub Getalllinks()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = False
url_name = Sheet1.Range("E4")
If url_name = "" Then Exit Sub
IE.navigate (url_name)
Do
DoEvents
Loop Until IE.ReadyState = 4
Set AllHyperlinks = IE.Document.getElementsByTagName("A")
Sheet1.ListBox1.Clear
For Each hyper_link In AllHyperlinks
Sheet1.ListBox1.AddItem (hyper_link)
Next
IE.Quit
End Sub