+ Reply to Thread
Results 1 to 7 of 7

Run macro when formula results changes based on different input cell

  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:

    Please Login or Register  to view this content.
    Last edited by daggat; 06-05-2014 at 12:48 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    08-06-2013
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2013
    Posts
    671

    Re: Run macro when formula results changes based on different input cell

    Put your code in [CODE] tags. Does that code actually open up internet explorer? It doesn't do that for me and I don't know how to open outside applications from excel.
    1. Include a sample workbook with an example of the result you want
    2. Use [CODE] and [FORMULA] wrappers for your VBA code or excel formulas
    3. If your question has been answered, mark the thread as SOLVED and click on the "Add Rep" star to thank whoever helped you.

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

    Re: Run macro when formula results changes based on different input cell

    Hmm...I think I was not clear Well the code works well, it opens internet explorer but you don't notice (invisible). however, so far it only works if my input is in "city" which will look exactly like e.g. "San-Diego-CA-92104/home-values" but what I want is, that I have my several inputs which will at the end result in "San-Diego-CA-92104/home-values" (easy with excel) and then execute the macro by grabbing the last result. But it doesn't because I always have to click in it so far. Do you understand now what I mean? Thank you so far.
    Last edited by daggat; 06-05-2014 at 01:05 AM.

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Run macro when formula results changes based on different input cell

    Hi, daggat,

    Worksheet_Change needs a direct entry or edit to a cell. If you placed a Formula in that cell you should either monitor the cells which deliver the values for that cell or use Worksheet_Calculate as that event would be triggered on any recalculation (it may be restricted to work on a sheet or in part of a sheet) and allow a code to run when any calculation is made, if you use it for a workbook or worksheet any volatile formulas like Date/Now/Rand would also start the macro as they force a calculation.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

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

    Re: Run macro when formula results changes based on different input cell

    Hi Holger,

    thank you very much for your reply. Is there any other way of solving it? I attach the excel file. as you will see, at the moment it runs the macro if I do changes in "B4", but I want that the macro runs when I enter any value in "B1" or "B2" or "B3", and then grabs the value in "E4" which it needs to fulfill the url and run the task successfully. Any idea? How would the command look like with Worksheet_Calculate, I have been trying that, but don't really know how to implement it. Thank you a lot!!!!!
    Attached Files Attached Files

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

    Re: Run macro when formula results changes based on different input cell

    Okay I solved the problem

    it may not be a nice solution but it works.

    Just to show what I meant

    Please Login or Register  to view this content.
    Thanks for the responses though!!!!!! I really appreciated!!!

    David
    Last edited by daggat; 06-05-2014 at 02:44 AM.

  7. #7
    Valued Forum Contributor
    Join Date
    08-06-2013
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2013
    Posts
    671

    Re: Run macro when formula results changes based on different input cell

    I'm really curious about this, because I'd like to be able to do something similar. How is it supposed to work, because it won't do anything for me. I changed visible to true and tried changing the values of all the cells to be different cities and nothing happened.

+ Reply to Thread

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