Pregunta

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?

¿Fue útil?

Solución

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

Otros consejos

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top