P
Phil Hageman
This worksheet code works okay - except that it allows the
user to leave the worksheet without correcting the
improper cell data entries. They can click okay to the
message, and leave the worksheet. What additional code
could be added to make the user correct the data before
allowing them to leave the worksheet?
Private Sub Worksheet_Change(ByVal Target As Range)
If [M15] < [M16] Or [M47] < [M48] Or [M79] < [M80] Then
MsgBox "Target cannot be greater than Chart Max"
ElseIf [M16] < [M18] Or [M48] < [M50] Or [M80] < [M82] Then
MsgBox "UCL cannot be greater than Target"
ElseIf [M18] < [M22] Or [M50] < [M54] Or [M82] < [M86] Then
MsgBox "LCL cannot be greater than UCL"
End If
End Sub
Thanks, Phil
user to leave the worksheet without correcting the
improper cell data entries. They can click okay to the
message, and leave the worksheet. What additional code
could be added to make the user correct the data before
allowing them to leave the worksheet?
Private Sub Worksheet_Change(ByVal Target As Range)
If [M15] < [M16] Or [M47] < [M48] Or [M79] < [M80] Then
MsgBox "Target cannot be greater than Chart Max"
ElseIf [M16] < [M18] Or [M48] < [M50] Or [M80] < [M82] Then
MsgBox "UCL cannot be greater than Target"
ElseIf [M18] < [M22] Or [M50] < [M54] Or [M82] < [M86] Then
MsgBox "LCL cannot be greater than UCL"
End If
End Sub
Thanks, Phil