Dear Excel Expert
By using the below Sheet1 code I am getting a pop-up Message When I edit Sheet2("E10:G11")
But I need to modify the code to .Undo the previous action after a pop-up message. I don't know how and what code to be changed.
When I edit Sheet2("E10:G11").Value Then Sheet1("K15:M15").Value will change. If the Sheet1 value gets negative then the pop-up will alert the user. At the same time, I want to do Undo the previous action after the alert message.
Workbook Link is below.
Please do the modification in the code. Thanks in advance.
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"