Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have a spreadsheet that is tracking stock prices. The cell with the price
is fed by a DDE link. Stock Price AIG 100 AXP 100 AMAT 100 AMGN 100 AMD 100 I am trying to create a visual monitoring tool. I was hoping to have the cell (ColB) change color (any color will do) everytime the price changes. For example, if the cell initially is no color, on the first change, color switches to green, on the next change, back to no color, on the 3rd price change, back to green etc. Is this type of thing possible ? Thank you in advance. |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
One way:
Put this in your worksheet code module (right-click the worksheet tab and choose View Code): Private Sub Worksheet_Change(ByVal Target As Excel.Range) Const sRANGE As String = "B2:B100" Const nCOLORINDEX As Long = 10 'Green With Target If .Count 1 Then Exit Sub If Not Intersect(.Cells, Range(sRANGE)) Is Nothing Then With .Interior .ColorIndex = IIf(.ColorIndex = nCOLORINDEX, _ xlColorIndexNone, nCOLORINDEX) End With End If End With End Sub In article , carl wrote: I have a spreadsheet that is tracking stock prices. The cell with the price is fed by a DDE link. Stock Price AIG 100 AXP 100 AMAT 100 AMGN 100 AMD 100 I am trying to create a visual monitoring tool. I was hoping to have the cell (ColB) change color (any color will do) everytime the price changes. For example, if the cell initially is no color, on the first change, color switches to green, on the next change, back to no color, on the 3rd price change, back to green etc. Is this type of thing possible ? Thank you in advance. |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thank you very much.
I tried this out but could not get it to work . I have a formula in ColB. Does that make a difference ? "JE McGimpsey" wrote: One way: Put this in your worksheet code module (right-click the worksheet tab and choose View Code): Private Sub Worksheet_Change(ByVal Target As Excel.Range) Const sRANGE As String = "B2:B100" Const nCOLORINDEX As Long = 10 'Green With Target If .Count 1 Then Exit Sub If Not Intersect(.Cells, Range(sRANGE)) Is Nothing Then With .Interior .ColorIndex = IIf(.ColorIndex = nCOLORINDEX, _ xlColorIndexNone, nCOLORINDEX) End With End If End With End Sub In article , carl wrote: I have a spreadsheet that is tracking stock prices. The cell with the price is fed by a DDE link. Stock Price AIG 100 AXP 100 AMAT 100 AMGN 100 AMD 100 I am trying to create a visual monitoring tool. I was hoping to have the cell (ColB) change color (any color will do) everytime the price changes. For example, if the cell initially is no color, on the first change, color switches to green, on the next change, back to no color, on the 3rd price change, back to green etc. Is this type of thing possible ? Thank you in advance. |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Yes, that makes a difference - Worksheet_Change() only fires when a
cell's value is changed manually or via link. Hard to tell what to change without knowing how your data is input... In article , carl wrote: I tried this out but could not get it to work . I have a formula in ColB. Does that make a difference ? |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thank you again. The price data in ColB is coming from a "DDE Link". This is
a "formula" that reads in streaming data from a data source. Does that clarify ? "JE McGimpsey" wrote: Yes, that makes a difference - Worksheet_Change() only fires when a cell's value is changed manually or via link. Hard to tell what to change without knowing how your data is input... In article , carl wrote: I tried this out but could not get it to work . I have a formula in ColB. Does that make a difference ? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
run a macro in a locked cell | Excel Discussion (Misc queries) | |||
Closing File Error | Excel Discussion (Misc queries) | |||
macro help | Excel Discussion (Misc queries) | |||
Cell Change Color - Need Help | New Users to Excel | |||
Possible Lookup Table | Excel Worksheet Functions |