I have developed an Excel Real-Time Data Feed (RTD) to monitor Stock Prices as they arrive.
I Would like to find a way to change the color of a cell as prices change.
For example, a cell initially Green would turn to Red when the value changes (new price occurred on it via RTD Formula it contains) and then change back to Green when a new price arrives, and so on...
相关问题
- Excel sunburst chart: Some labels missing
- Error handling only works once
- Error handling only works once
- Excel formula in VBA code
- Excel VBA run time error 450 from referencing a ra
相关文章
- Get column data by Column name and sheet name
- programmatically excel cells to be auto fit width
- Unregister a XLL in Excel (VBA)
- Unregister a XLL in Excel (VBA)
- How to prevent excel from truncating numbers in a
- numeric up down control in vba
- Declare a Range relative to the Active Cell with V
- What's the easiest way to create an Excel tabl
I was looking for same. My scenario was like change the color of cell when value is select from list. Each list item corresponds for a color.
What eventually worked for me is:
Maybe this can get you started? I supose a event is raised when the real time data is refreshed. the concept sis to store the real time data in a variabele and check if it has changed
This solution reposonds to a
Calculation
event. I am not entirely sure if an RTD update triggers this, so you will need to experiment.Add this code to the
Worksheet
module containing your RTD calls.It keeps a copy of the sheet data in memory from the last calculation, and on each calc compares new values.
It limits its action to cells containing your formula.
Alternatively, the most simple is this code :
Both the previous answer assume that Real-time data feed triggers worksheet events. I can find nothing in the RTD documents to confirm or deny this assumption. However, if it does trigger worksheet events, I would have thought that Worksheet_Change would have been the most useful since it identifies a cell that has changed.
The following might be worth trying. It must be placed in the code area for the relevant worksheet.