+ Reply to Thread
Results 1 to 3 of 3

How run a Macro if cell A1 equals a value derived from a formula

  1. #1
    Registered User
    Join Date
    01-20-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    How run a Macro if cell A1 equals a value derived from a formula

    In the attached spreadsheet Cell A1 contains the formula =IF(E7=50,"X",""). I've recorded a simple macro to write numbers into cells J1:J5 if I press a button. But I want the macro to run when cell A1 shows the letter X. It mustn't run again when X disappears from cell A1. But it must always run when X reappears in cell A1. I can test by manually changing cell E5 to 10, but in "real life" the application will be downloading realtime variable data about oil prices.
    Any suggestions greatly appreciated!
    Attached Files Attached Files
    Last edited by Stickleback; 01-20-2012 at 01:48 PM.

  2. #2
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: How run a Macro if cell A1 equals a value derived from a formula

    You could use something like this in the Sheet1 code module

    Please Login or Register  to view this content.
    Good luck.

  3. #3
    Registered User
    Join Date
    01-20-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: How run a Macro if cell A1 equals a value derived from a formula

    That worked perfectly. Thanks for your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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