Krishnab4u
New Member
- Joined
- Jul 16, 2018
- Messages
- 34
Dear Sir,
i take a bow for all your wonderful guidance for a newbee like me.
I am working in a excel file where I have to make a cell flash when date value of the same is not equal to current date and to stop when the value is equal to current date.
i used the following code.
But it doesnt stop after the current date is keyed in the cell.
this goes in the separate module
the following goes inside the worksheet
Kindly help.
i take a bow for all your wonderful guidance for a newbee like me.
I am working in a excel file where I have to make a cell flash when date value of the same is not equal to current date and to stop when the value is equal to current date.
i used the following code.
But it doesnt stop after the current date is keyed in the cell.
this goes in the separate module
Code:
Option Explicit
Public RunWhen As Double
Sub StartBlink()
If Worksheets("Summary").Range("X2:AA2").Interior.ColorIndex = 3 Then
Worksheets("Summary").Range("X2:AA2").Interior.ColorIndex = 4
Else
Worksheets("Summary").Range("X2:AA2").Interior.ColorIndex = 3
End If
RunWhen = Now + TimeSerial(0, 0, 2)
Application.OnTime RunWhen, "StartBlink", , True
End Sub
Sub StopBlink()
Worksheets("Summary").Range("X2:AA2").Interior.ColorIndex = xlAutomatic
Application.OnTime RunWhen, "StartBlink", , False
End Sub
the following goes inside the worksheet
Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Range("Z2") <> Date And CellCheck = False Then
Call StartBlink
CellCheck = True
ElseIf ("Z2") = Date And CellCheck = False Then
Call StopBlink
CellCheck = False
End If
End Sub
Kindly help.