Forum Discussion

Matt_Croke's avatar
Matt_Croke
Copper Contributor
Mar 01, 2023

excel "signal"

Is it possible to take a 0 / 1 signal in a cell and convert that "1" signal and change it to a momentary signal, signaling for like 1-2-3 seconds and then resets, almost like a "flash". I'm trying to eliminate the "1" signal to keep being "read" down the line in that cell.

2 Replies

  • SnowMan55's avatar
    SnowMan55
    Bronze Contributor

    Matt_Croke 

    If that "take … and change …" action is to be triggered by the change of value in a predefined cell (or a predefined set of cells), then conditionally yes.  But the solution I am thinking of involves procedural code in VBA, which is implemented only for desktop versions of Excel.  Which version are you using, on which operating system?  Are you prepared to accept the security risks involved with using VBA?

     

    VBA code that is written in a Worksheet_Change event handler will be invoked every time the value in any cell of the worksheet changes.  (For a signal cell, that change is probably going to occur because it contains a formula that has been recalculated.  Alternatively, some other code might be writing a value into the signal cell.)  The code is informed which cells were changed, and it can determine: 1) which if any of the changed cells was a signal cell, and 2) what the new cell value is.  If the value in a signal cell changes to 1, the code can then:

    1. change (e.g.) the signal cell's highlighting color;
    2. wait for a couple of seconds; and
    3. change the signal cell's value (e.g., to zero if you never want it to signal again), or change its formula or something in a related cell (if you want the cell to signal under some future condition).  The latter type of change will probably require some design work by you.

    << to keep being "read" down the line in that cell. >>

    Please clarify what you mean.  You should also describe more generally what is to cause this signaling.

     

    • Matt_Croke's avatar
      Matt_Croke
      Copper Contributor

      SnowMan55 

       

      Thank you, the path you described was basically the same as what I have come up with. I haven't been able to test yet but will soon.  It's used in the interfacing of a trading machine. Excel now having better ability for that as a language, may have more of a demand for things like this trigger. Lots of signals are sent when a condition is met, that initiates the trade, but you may then want to exit the trade, but in doing so the condition is still met, and it fires off another position as soon as you go flat on the first position. A trigger could accept the change from a zero to a 1 in value, show the 1 for two seconds, and then revert to zero, waiting for next new signal.  Thank you for your time.  

Resources