Question

Take as example the following code which should state whether the content of Cell A3 is greater or smaller than 0.25, where in Cell A3 we have a formula like RAND() whoch generates random numbers between 0 and 1.

Private Sub Worksheet_Change(ByVal Target As Range)

Calculate

   If Range("A3") > 0.25 Then

      Range("B3") = "greater than 0.25"

    Else: Range("B3") = "smaller than 0.25"

    End If

End Sub

How to make this Event conditions to be verified in continuous time?

Was it helpful?

Solution

What about using timer? this function calls each 1 second

Sub Test()

   Calculate

   If Range("A3") > 0.25 Then
      Range("B3") = "greater than 0.25"
   Else 
      Range("B3") = "smaller than 0.25"
   End If

   Application.OnTime Now + TimeSerial(0, 0, 1), "Test"
End Sub

OTHER TIPS

I think there is no option for that. Have been looking for it myself. There is no change event for calculated cells. The only option is to check dependencies of a calculated field but in this case there are none.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top