Hello,
I am trying to create a code that when values in cells "g10:g13" goes below a specific number, a msg box pops up. I used the below.
Private Sub Worksheet_Calculate()
If Range("g10").Value < 352 Then
MsgBox "T2 Low Stop Approaching! "
End If
If Range("g11").Value < 362 Then
MsgBox "T3 Low Stop Approaching!"
End If
If Range("g12").Value < 1038 Then
MsgBox "T4 Low Stop Approaching!"
End If
If Range("g13").Value < 1037 Then
MsgBox "T5 Low Stop Approaching!"
End If
End Sub
It does pop up when the value is below, but it does it for every cell. For instance when the value in G10 recalculates to 320, msg box (t2) pops up, but if the value in g11 is calculated and it gets to 312, while g10 is still 320, both msg boxes (T2 and T3) pops up. To get only T3, the value of G10 needs to be above the 352 number. If again cell b19 gets recalculated, the msg boxes also pop up.
I need the messages to pop only when g10:g13 is recalculated and their values go below the relevant limit.
I am trying to create a code that when values in cells "g10:g13" goes below a specific number, a msg box pops up. I used the below.
Private Sub Worksheet_Calculate()
If Range("g10").Value < 352 Then
MsgBox "T2 Low Stop Approaching! "
End If
If Range("g11").Value < 362 Then
MsgBox "T3 Low Stop Approaching!"
End If
If Range("g12").Value < 1038 Then
MsgBox "T4 Low Stop Approaching!"
End If
If Range("g13").Value < 1037 Then
MsgBox "T5 Low Stop Approaching!"
End If
End Sub
It does pop up when the value is below, but it does it for every cell. For instance when the value in G10 recalculates to 320, msg box (t2) pops up, but if the value in g11 is calculated and it gets to 312, while g10 is still 320, both msg boxes (T2 and T3) pops up. To get only T3, the value of G10 needs to be above the 352 number. If again cell b19 gets recalculated, the msg boxes also pop up.
I need the messages to pop only when g10:g13 is recalculated and their values go below the relevant limit.