Thanks Tom, I only posted part of the code and after
further testing I realize that the entire code is creating
the trouble. Still don't know what it is but here is the
entire code.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error Resume Next
Application.EnableEvents = False
If Union(Target, Me.Range("AH3,I11,T11")).Address =
Me.Range("AH3,I11,T11").Address _
And InStr(1, Target, "#") > 0 Then
Target.Select
MsgBox "The following symbols are not allowed in this
field! # < > ? [ ] : * \ and / "
Target = ""
End If
If Union(Target, Me.Range("AH3,I11,T11")).Address =
Me.Range("AH3,I11,T11").Address _
And InStr(1, Target, "<") > 0 Then
Target.Select
MsgBox "The following symbols are not allowed in this
field! ""# < > ? [ ] : * \ and /"" "
Target = ""
End If
If Union(Target, Me.Range("AH3,I11,T11")).Address =
Me.Range("AH3,I11,T11").Address _
And InStr(1, Target, ">") > 0 Then
Target.Select
MsgBox "The following symbols are not allowed in this
field! ""# < > ? [ ] : * \ and /"" "
Target = ""
End If
If Union(Target, Me.Range("AH3,I11,T11")).Address =
Me.Range("AH3,I11,T11").Address _
And InStr(1, Target, "?") > 0 Then
Target.Select
MsgBox "The following symbols are not allowed in this
field! ""# < > ? [ ] : * \ and /"" "
Target = ""
End If
If Union(Target, Me.Range("AH3,I11,T11")).Address =
Me.Range("AH3,I11,T11").Address _
And InStr(1, Target, "[") > 0 Then
Target.Select
MsgBox "The following symbols are not allowed in this
field! ""# < > ? [ ] : * \ and /"" "
Target = ""
End If
If Union(Target, Me.Range("AH3,I11,T11")).Address =
Me.Range("AH3,I11,T11").Address _
And InStr(1, Target, "]") > 0 Then
Target.Select
MsgBox "The following symbols are not allowed in this
field! ""# < > ? [ ] : * \ and /"" "
Target = ""
End If
If Union(Target, Me.Range("AH3,I11,T11")).Address =
Me.Range("AH3,I11,T11").Address _
And InStr(1, Target, ":") > 0 Then
Target.Select
MsgBox "The following symbols are not allowed in this
field! ""# < > ? [ ] : * \ and /"" "
Target = ""
End If
If Union(Target, Me.Range("AH3,I11,T11")).Address =
Me.Range("AH3,I11,T11").Address _
And InStr(1, Target, "*") > 0 Then
Target.Select
MsgBox "The following symbols are not allowed in this
field! ""# < > ? [ ] : * \ and /"" "
Target = ""
End If
If Union(Target, Me.Range("AH3,I11,T11")).Address =
Me.Range("AH3,I11,T11").Address _
And InStr(1, Target, "\") > 0 Then
Target.Select
MsgBox "The following symbols are not allowed in this
field! ""# < > ? [ ] : * \ and /"" "
Target = ""
End If
If Union(Target, Me.Range("AH3,I11,T11")).Address =
Me.Range("AH3,I11,T11").Address _
And InStr(1, Target, "/") > 0 Then
Target.Select
MsgBox "The following symbols are not allowed in this
field! ""# < > ? [ ] : * \ and /"" "
Target = ""
End If
Application.EnableEvents = True
End Sub
-----Original Message-----
I pasted your code into a sheet module and couldn't reproduce the problem.
I did add a line to turn events back on at the end.
--
Regards,
Tom Ogilvy
.