I have the following code that I want to have a message box pop up if the value of cell H104 is more or less than the value of cell F104 by more than 0.02. I have been playing with this code for about 3 days now but can't seem to get it to work. Any Ideas?
![]()
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) Dim Cell As Range If Application.Intersect(Target, Range("H104")) Is Nothing Then Exit Sub For Each Cell In Range("H104") If (Cell.Value < (Range("F104").Value - 0.02)) Then MsgBox "SCALE CHECK 1 HAS FAILED CALIBRATION AND MUST BE RECALIBRATED BEFORE IT CAN BE USED TO TAKE WEIGHTS" Exit Sub End If Next Cell If Application.Intersect(Target, Range("H104")) Is Nothing Then Exit Sub For Each Cell In Range("H104") If (Cell.Value > (Range("F104").Value + 0.02)) Then MsgBox "SCALE check 1 HAS FAILED CALIBRATION AND MUST BE RECALIBRATED BEFORE IT CAN BE USED TO TAKE WEIGHTS" Exit Sub End If Next Cell End Sub
Bookmarks