I'm trying to design a macro that can be run for many cells that will go out to the web to run a search and paste the results in the relevant adjacent cell. Instead of the results showing up on a message box, how do I write this? I'm very new to this so please excuse me if I sound like I haven't a clue.
Here's my script:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = Range("tn").Row And _
Target.Row = Range("tn").Row Then
Dim IE As New InternetExplorer
'IE.Visible = True
IE.navigate "http://www.verifyphone.com/" & Range("tn").Value
Do
DoEvents
Loop Until IE.readyState = READYSTATE_COMPLETE
Dim Doc As HTMLDocument
Set Doc = IE.document
Dim std As String
std = Trim(Doc.getElementsByTagName("td")(15).innerText)
IE.Quit
MsgBox std
End If
End Sub
Here's how I want the results to look like:
image001.jpg
Let me know if you have any questions, I look forward to your help! -Eric
Bookmarks