+ Reply to Thread
Results 1 to 3 of 3

Can I start a macro from a cell by using a formula

  1. #1
    PraxisPete
    Guest

    Can I start a macro from a cell by using a formula

    Is it possible to enter a formula into a cell, and if the result returns True
    then a macro runs? The Formula may look like this

    =If(Logical_Test,[Call”MacroName”],[Value_if_False])

    Can it be done if the result returns False?


  2. #2
    Arvi Laanemets
    Guest

    Re: Can I start a macro from a cell by using a formula

    No

    For formulas/functions no activities are allowed - they only can display
    information in cell, they are situated.

    --
    When sending mail, use address arvil<at>tarkon.ee
    Arvi Laanemets


    "PraxisPete" <[email protected]> wrote in message
    news:[email protected]...
    > Is it possible to enter a formula into a cell, and if the result returns

    True
    > then a macro runs? The Formula may look like this
    >
    > =If(Logical_Test,[Call”MacroName”],[Value_if_False])
    >
    > Can it be done if the result returns False?
    >




  3. #3
    Registered User
    Join Date
    02-25-2005
    Posts
    84
    Arvi is correct, you cant activate a macro directly from a formula. What you can do however is, on the Worksheet_Calculate() event, have a macro that:-

    Please Login or Register  to view this content.
    Of course this macro will run again and again while ever your criteria is being met, unless you code it to only run once, or even only once each criteria.

    eg.
    A1 = 0, criteria not met, macro not run
    A1 = 1, criteria met, macro run
    A1 = 1, still met but already run so this time, not run
    A1 = 0 criteria not met, macro not run, macro reset
    A1 = 1, criteria met for first time after being reset, macro run
    ... etc

+ 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