Hi,
I'm using the url extension for Google's "I'm feeling lucky" functionality but want to copy the url this function opens (i.e. the direct url). I'm using the below macro which works fine but need it to loop down a list until it finds a blank cell.
I have a list of hyperlinks in column E using the above and want to paste the direct hyperlink in column F.
Any help would be greatly appreciated
Sub GetDirectLink()
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = False
.Navigate Range("E1")
Do Until .ReadyState = 4: DoEvents: Loop
Application.Wait Now + TimeValue("00:00:01")
Set doc = IE.Document
Cells(1, 5) = IE.Document.URL
IE.Quit
Set IE = Nothing
End With
End Sub
I'm using the url extension for Google's "I'm feeling lucky" functionality but want to copy the url this function opens (i.e. the direct url). I'm using the below macro which works fine but need it to loop down a list until it finds a blank cell.
I have a list of hyperlinks in column E using the above and want to paste the direct hyperlink in column F.
Any help would be greatly appreciated
Sub GetDirectLink()
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = False
.Navigate Range("E1")
Do Until .ReadyState = 4: DoEvents: Loop
Application.Wait Now + TimeValue("00:00:01")
Set doc = IE.Document
Cells(1, 5) = IE.Document.URL
IE.Quit
Set IE = Nothing
End With
End Sub
Last edited: