View Single Post
  #1   Report Post  
nobbyknownowt nobbyknownowt is offline
Member
 
Posts: 57
Default Validate a result

Can someone correct my macro please cos I'm soooooo close?
Been working on this sheet for days now and starting to get punch drunk!

I have borrowed this off the site but cannot adapt it to my needs.

I wish to validate a result in a cell and display a msgbox once I have gone over a target figure.
The macro
Private Sub Worksheet_Calculate()
If Me.Range("o16").Value 5000 Then
MsgBox "too high - do something!"
End If
End Sub
Works great once I get to over 5000
But i want it to pick its own maximum total from the sum of d27:i27 instead of 5000.
How do I adapt this macro to do this as all I keep getting is syntax errors
Thanks to all
Cheers
Nobby