samedi 11 avril 2015

Flashing cells in excell despite conditional formatting

I have some code below which makes cells within a predefined range, flash color from white to red.. For my purposes, I need this code to work only on cells that have certain values in them.. for example any cell that has a numerical value below 50. Any ideas.. the code is as follows



Public NextFlash As Double
Public Const FR As String = "Sheet1!B3:D6"
Sub StartFlashing()

If Range(FR).Interior.ColorIndex = 3 Then
Range(FR).Interior.ColorIndex = xlColorIndexNone
Else
Range(FR).Interior.ColorIndex = 3
End If
NextFlash = Now + TimeSerial(0, 0, 1)
Application.OnTime NextFlash, "StartFlashing", , True
End Sub
Sub StopFlashing()
Range(FR).Interior.ColorIndex = xlColorIndexNone
Application.OnTime NextFlash, "StartFlashing", , False
End Sub

Aucun commentaire:

Enregistrer un commentaire