amabdullah
Board Regular
- Joined
- Mar 13, 2010
- Messages
- 55
Dear all, can some one help me for the following:
I am trying to get continue flushing contents and cell B1, once value of cell A1 <=0. Flushing must stop after value of cell A1 is >0. I got the following code but even cell A1 value >0 the cell still flushing.
Public Sub Blinker(ByVal rng As Range)
'Causes the cell "rng" to blink 10 times
Dim myCounter As Integer
Do Until myCounter = 100
With rng.Interior
If .ColorIndex = 6 Then
.ColorIndex = xlNone
Else
.ColorIndex = 6
End If
Pause (0.2)
myCounter = myCounter + 1
End With
Loop
End Sub
Public Sub Pause(ByVal dblSecs As Double)
'Pauses the execution of code for the specified number of seconds
Dim Start
Start = Timer
Do While Timer < Start + dblSecs
DoEvents
Loop
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
'Test the value of the specified cell
If Target.Address = "$A$1" Then
If Target.Value < 0 Then Call Blinker(Target)
End If
End Sub
I am trying to get continue flushing contents and cell B1, once value of cell A1 <=0. Flushing must stop after value of cell A1 is >0. I got the following code but even cell A1 value >0 the cell still flushing.
Public Sub Blinker(ByVal rng As Range)
'Causes the cell "rng" to blink 10 times
Dim myCounter As Integer
Do Until myCounter = 100
With rng.Interior
If .ColorIndex = 6 Then
.ColorIndex = xlNone
Else
.ColorIndex = 6
End If
Pause (0.2)
myCounter = myCounter + 1
End With
Loop
End Sub
Public Sub Pause(ByVal dblSecs As Double)
'Pauses the execution of code for the specified number of seconds
Dim Start
Start = Timer
Do While Timer < Start + dblSecs
DoEvents
Loop
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
'Test the value of the specified cell
If Target.Address = "$A$1" Then
If Target.Value < 0 Then Call Blinker(Target)
End If
End Sub