Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a cell that is populated through a formula, I was hoping to have an
error to display if the formula brings that cell below zero. I would also like to cancel the event that lead up to this error. Any ideas? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Paste following code in worksheet's code
(right-click on sheet tab, select Code) '-------------------------- Private Sub Worksheet_Calculate() If Range("A1").Value < 0 Then MsgBox ("Below zero") Application.EnableEvents = False Application.Undo Application.EnableEvents = True End If End Sub '------------------------------------ HTH -- AP "Dan Connors" a écrit dans le message de ... I have a cell that is populated through a formula, I was hoping to have an error to display if the formula brings that cell below zero. I would also like to cancel the event that lead up to this error. Any ideas? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Fantastic! Thank you so much.
"Ardus Petus" wrote: Paste following code in worksheet's code (right-click on sheet tab, select Code) '-------------------------- Private Sub Worksheet_Calculate() If Range("A1").Value < 0 Then MsgBox ("Below zero") Application.EnableEvents = False Application.Undo Application.EnableEvents = True End If End Sub '------------------------------------ HTH -- AP "Dan Connors" a écrit dans le message de ... I have a cell that is populated through a formula, I was hoping to have an error to display if the formula brings that cell below zero. I would also like to cancel the event that lead up to this error. Any ideas? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the feedback!
-- AP "Dan Connors" a écrit dans le message de ... Fantastic! Thank you so much. "Ardus Petus" wrote: Paste following code in worksheet's code (right-click on sheet tab, select Code) '-------------------------- Private Sub Worksheet_Calculate() If Range("A1").Value < 0 Then MsgBox ("Below zero") Application.EnableEvents = False Application.Undo Application.EnableEvents = True End If End Sub '------------------------------------ HTH -- AP "Dan Connors" a écrit dans le message de ... I have a cell that is populated through a formula, I was hoping to have an error to display if the formula brings that cell below zero. I would also like to cancel the event that lead up to this error. Any ideas? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Data Validation - Restrict entry but without dropdown | Excel Discussion (Misc queries) | |||
How do I restrict data entry to one of two columns but not both? | Excel Discussion (Misc queries) | |||
How do I restrict data entry to one of two columns | Excel Discussion (Misc queries) | |||
Restrict Data Entry to only 4 possible entries | Excel Programming | |||
Restrict Data Entry to only 4 possible entries | Excel Programming |