Results 1 to 7 of 7

Run macro when formula results changes based on different input cell

Threaded View

  1. #1
    Registered User
    Join Date
    06-01-2014
    Posts
    4

    Run macro when formula results changes based on different input cell

    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
    Last edited by daggat; 06-05-2014 at 12:48 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Macro to search through dates and display results based on user input
    By Alan668 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-22-2012, 12:40 PM
  2. Automatic Formula Input Based on User Input Using a Macro
    By Drayloc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-03-2012, 12:10 PM
  3. Pair down results based on input
    By pjbassdc in forum Excel General
    Replies: 6
    Last Post: 09-14-2011, 02:35 PM
  4. Formula that updates results based on a single input
    By 3dmdlr in forum Excel General
    Replies: 1
    Last Post: 01-25-2011, 12:48 PM
  5. [SOLVED] Can I start a macro based on cell input value
    By teetime in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-30-2005, 09:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1