Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
MsgBox Question - HELP!
I need to set up a warning message box that appears if a
value exceeds 80. I need the message to say something like..."Warning, hours exceed limitation, Do you want to continue?" If they do, then they will be allowed to enter in the amount, if not, then they screen will just go back to how it was before they entered to high number. Can anyone help me on this? My code is not working. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
MsgBox Question - HELP!
Hi Ann
try the following code for cell A1 Private Sub Worksheet_Change(ByVal Target As Excel.Range) Static Save_old_cell Dim msg_return If Intersect(Target, Me.Range("A1")) Is Nothing Then Exit Sub If Target.Cells.Count 1 Then Exit Sub On Error GoTo CleanUp With Target If .Value 80 Then msgreturn = MsgBox("Value is too large - Continue?", vbOKCancel) If msgreturn = 2 Then Application.EnableEvents = False .Value = Save_old_cell End If End If Save_old_cell = .Value End With CleanUp: Application.EnableEvents = True End Sub HTH Frank Ann wrote: I need to set up a warning message box that appears if a value exceeds 80. I need the message to say something like..."Warning, hours exceed limitation, Do you want to continue?" If they do, then they will be allowed to enter in the amount, if not, then they screen will just go back to how it was before they entered to high number. Can anyone help me on this? My code is not working. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
msgbox question | Excel Discussion (Misc queries) | |||
MsgBox Question | Excel Programming | |||
MsgBox question | Excel Programming | |||
Msgbox question | Excel Programming | |||
MsgBox Question | Excel Programming |