Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need final code tweak
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need someone to help tweak a code | Excel Discussion (Misc queries) | |||
SUMPRODUCT - Tweak | Excel Worksheet Functions | |||
Does anyone know how to tweak Custom Auto Filter box? | New Users to Excel | |||
Array Help Tweak | Excel Worksheet Functions | |||
Can someone please tweak my Macro? | Excel Discussion (Misc queries) |