Hi all together,
I'm pretty new to vba and my knowledge is less than basic. However i've been able to successfully create a macro which automatically runs when cell value changes (by manual input/enter). But I need to change something but get stuck.
What I need is either the macro runs when cell "city" changes based on a formula (other cells are input) or, that city is changed manually but in the line IE.navigate "http://://www.zillow.com/" & Range("city").Value it will complete the URL based on another cell.
Hopefully you understand my problem and have a solution. Thank you very much in advance,
David
Here is the macro:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = Range("city").Row And _
Target.Column = Range("city").Column Then
Dim IE As New InternetExplorer
IE.Visible = False
IE.navigate "http://www.zillow.com/" & Range("city").Value
Do
DoEvents
Loop Until IE.readyState = READYSTATE_COMPLETE
Dim Doc As HTMLDocument
Set Doc = IE.document
Dim aa As String
aa = Doc.getElementsByClassName("value")(0).innerText
IE.Quit
Dim ab As Variant
ab = Split(aa, ".")
Range("homevalue").Value = ab(0)
End If
End Sub
Bookmarks