Flash/Blink Cell Color Based on Live Changing Values while Keeping Background Color of the Cell the same.

jatansanand

New Member
Joined
Aug 16, 2013
Messages
1
I have this excel document with a Finansu Add-in that pulls live stock feeds from Google Finance. As of now, if the % change is negative overall then the cell is red and if it is positive it is green. I want to find a way to make it so if the stock changed from 1% down to .5% down the cell will flash green for a second or 2 and then go back to being red. And all of those variations. I know that I will most likely have to use VBA to do this. Not sure how though.

Currently I have 3 modules in my excel file.
Module 1:
Public oldval, myval
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range(J7:N18)) Is Nothing
Then
oldval = myval
If Target.Value > oldval Then
Range(J7:N18 & Target.Row).Interior.ColorIndex =
4
Else
Range(J7:N18 & Target.Row).Interior.ColorIndex =
3
End If
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As
Range)
If Not Intersect(Target, Range(J7:N18)) Is Nothing

Module 2:
Public oldval, myval


Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range(J7:N18)) Is Nothing Then
oldval = myval
If Target.Value > oldval Then
Range(J7:N18 & Target.Row).Interior.ColorIndex = 4
Else
Range(J7:N18 & Target.Row).Interior.ColorIndex = 3
End If
End If
End Sub


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range(J7:N18)) Is Nothing Then
myval = Target.Value
End If
End Sub

Module 3:
Public oldval, myval
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range(J8:N17)) Is Nothing
Then
oldval = myval
If Target.Value > oldval Then
Range(J8:N17 & Target.Row).Interior.ColorIndex =
4
Else
Range(J8:N17 & Target.Row).Interior.ColorIndex =
3
End If
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As
Range)
If Not Intersect(Target, Range(J7:N8)) Is Nothing
Sub COLORS()


End Sub


Thank you.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top