+ Reply to Thread
Results 1 to 4 of 4

Can an Excel macro be automatically run based upon data in a cell?

  1. #1
    chasedan
    Guest

    Can an Excel macro be automatically run based upon data in a cell?

    I'm trying to poke a DDE message to RSLINX from Excel based upon whether a
    cell in Excel contains the value 1 or 0. The value in the cell changes based
    upon a DDE link to a timer running on an Allen Bradley PLC (Micrologix 1100).
    I have a macro that can deliver the message but it must be initiated
    manually. Is there a way to launch the macro automatically?

  2. #2
    Chip Pearson
    Guest

    Re: Can an Excel macro be automatically run based upon data in a cell?

    I believe that if you provide a macro name to the OnData property
    of the Application object, that macro will run when a DDE update
    is made. E.g.,

    Sub AAA()
    Application.OnData "DoDDE"
    End Sub

    Sub DoDDE()
    ' do something
    End Sub


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "chasedan" <[email protected]> wrote in message
    news:[email protected]...
    > I'm trying to poke a DDE message to RSLINX from Excel based
    > upon whether a
    > cell in Excel contains the value 1 or 0. The value in the cell
    > changes based
    > upon a DDE link to a timer running on an Allen Bradley PLC
    > (Micrologix 1100).
    > I have a macro that can deliver the message but it must be
    > initiated
    > manually. Is there a way to launch the macro automatically?




  3. #3
    JakeyC
    Guest

    Re: Can an Excel macro be automatically run based upon data in a cell?

    Take a look at the Worksheet_Change and _Calculate events in the VBA
    editor, or press F1 and search for them in Help.

    These may suffice for what you need to do.


  4. #4
    JakeyC
    Guest

    Re: Can an Excel macro be automatically run based upon data in a cell?

    Take a look at the Worksheet_Change and _Calculate events in the VBA
    editor, or press F1 and search for them in Help.

    These may suffice for what you need to do.


+ 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