Conditional Message box ??

C

chimp

Is it possible to have a message box to come up only a criteria is no
met.

For example,

i have a garage that sells cars, if my target sales are 3 cars pe
month, but i have only sold 2, is it possible to have a message bo
appear to tell me that.

but if i have made the 3 sales then the box would not appear.

I could do with some code here please

cheers

And
 
A

Andy B

Andy

Rather than do it with a macro, why not use conditional formatting. If you
sell less than 3 sales, the background is red, if 3 or more it turns green.

Andy.
 
J

Jack Clumpkens

Andy,

The following module would do the trick. Right click on the tab and
select View Code. Then enter the following code assuming target sales
are in cell B2 and actual sales are in cell B3:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B3")) Is Nothing Then
If Target.Value < Range("B2").Value Then
MsgBox "Missed Sales Target."
End If
End If
End Sub

Jack Clumpkens
 
Top