Conditional Message box ??

  • Thread starter Thread starter chimp
  • Start date Start date
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
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top