Right mouse over the sheet name (i.e. Sheet1) and select view code, then paste this in, it will run when a change in the sheet is made;
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("D10").Value > 1 Then
If MsgBox("Correction Total Too High ! Please Check", vbOKOnly, "See range D10") = vbOK Then:
End If
End Sub
Or just use Validation, found under the Data drop down box. This allows you to specify the conditions of the values entered into the specific cells, and allows you to return an error message for incorrect values.
Edit: Validation will only work if a hard coded value is being typed into the cell. If it is a formula, link, or is pasted into the cell, use the code jimboy provided.
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.