+ Reply to Thread
Results 1 to 5 of 5

Run Macro From If Statement

  1. #1
    Registered User
    Join Date
    06-03-2005
    Posts
    4

    Run Macro From If Statement

    Is there a command to run a macro as the condition for TRUE in an IF statement?

  2. #2
    Forum Contributor
    Join Date
    05-04-2005
    Posts
    136
    if x=y then
    <<macroname>>
    end if

  3. #3
    Registered User
    Join Date
    08-18-2004
    Posts
    97
    Could you tell where is the IF statment located? in a Cell or in a Macro? it depends...

    Quote Originally Posted by bhalooneel
    Is there a command to run a macro as the condition for TRUE in an IF statement?

  4. #4
    Registered User
    Join Date
    06-03-2005
    Posts
    4
    It's in the cell.

  5. #5
    Registered User
    Join Date
    08-18-2004
    Posts
    97

    Talking

    Quote Originally Posted by bhalooneel
    It's in the cell.
    1. Put your IF in the cell
    2. Label the cell (lets say SwCell)
    3. put your macro in the Worksheet.Calculate. Something like


    Please Login or Register  to view this content.
    4. Pull the result of the Cell to your Macro with Range("Condition onSwCell")


    Your Macro will run every time the worksheet is calculated, if it in automatic calculation, always will be testting your condition and doing your code.


    Hope this helps

    Regards

    Jose Luis

+ 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