Eladamri,
You can use DataValidation for this. No code necessary.
Although it will not tell you how many characters you are off, only that it
is NOT 11.
If you really need the number chars off then:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("D1")) Is Nothing Then
If Len(Target.Text) < 11 Then
MsgBox "Not 11 chars: Length= " & Len(Target.Text) - 11
Target.Select
End If
End If
End Sub
Obviously changing "D1" to the range in question.
NickHK
"Eladamri" wrote in
message ...
Hi Guys,
Can you help me out.
I want to come up with a validation on Cell A1. The total number of
characters that will be entered should be exactly 11. If the number of
the characters that I entered is not exactly 11 it will be great if
there is a macro program that will show a message box that will prompt
me how many characters am I off.
any help is greatly appreciated. :)
--
Eladamri
------------------------------------------------------------------------
Eladamri's Profile:
http://www.excelforum.com/member.php...o&userid=35099
View this thread: http://www.excelforum.com/showthread...hreadid=562783