Anbuselvam K
Member
Dear Excel Genius
As per the below snapshot, if row 15 gets negative values when I change the values in rows 16 and 17, then I get the pop-up message.
If I press OK then it has to do ".Undo" to get back the previous positive values in row 15.
I used the below code for the pop-up message, need to add the codes to perform undo.
As per the below snapshot, if row 15 gets negative values when I change the values in rows 16 and 17, then I get the pop-up message.
If I press OK then it has to do ".Undo" to get back the previous positive values in row 15.
I used the below code for the pop-up message, need to add the codes to perform undo.
Code:
Private Sub Worksheet_Calculate()
For Each Cell In Range("$K$15:$M$15")
If Cell.Value < 0 Then MsgBox "WARNING! RAW MATERIALS Stock is not enough in the RM Code:- " & Cell.Offset(-2, -1).Value & " - " & Cell.Offset(-1, -1).Value, vbOKOnly, "CONSUMPTION IS MORE THAN THE RM STOCK"
Next Cell
End Sub