PDA

View Full Version : error help



wilg
05-02-2011, 06:20 PM
Hi guys, have an error with this bit of code when I select multiple cells and clearcontents or delete....any reason?

If I key the "PP" it works fine. Just when I select multiple cells if bugs out.

On Error GoTo ERROX
If (Target.Value) = "PP" Or (Target.Value) = "PU" Then
MsgBox "KEY"
ERROX:
End If

BrianMH
05-02-2011, 10:30 PM
On Error Goto ERROX
if target.cells.count > 1 exit sub
If (Target.Value) = "PP" Or (Target.Value) = "PU" Then
MsgBox "KEY"
ERROX:
End If


that should sort it.