View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones[_2_] Norman Jones[_2_] is offline
external usenet poster
 
Posts: 421
Default preventing data entry if one cell's value smaller then zero

Hi Taco,

On Error GoTo 0


Should read:

On Error GoTo Whoops




---
Regards.
Norman


"Norman Jones" wrote in message
...
Hi Taco,

Try:

'==========
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Rng As Range
Dim Rng2 As Range

With Me
Set Rng = .Range("E6:J185")
Set Rng2 = .Range("C3")
End With

If Not Intersect(Rng, Target) Is Nothing Then
If Rng2.Value <= 0 Then
On Error GoTo 0
Application.EnableEvents = False
MsgBox "You Dont Have Enough Points!"
Application.Undo
End If
End If
Whoops:
Application.EnableEvents = True
End Sub
'<<==========



---
Regards.
Norman