You cannot enforce a maximum number of characters while the user is editing
the text in the cell, but you can check it afterwards, warn the user it is
too long an entry and then truncated it down to the maximum number of
characters you want to permit in that column. Here is example of how to
enforce a 10 character maximum length in Column C...
Private Sub Worksheet_Change(ByVal Target As Range)
Const MaxLen As Long = 10
If Target.Column = 3 And Len(Target.Value) > MaxLen Then
MsgBox "Entry too long; it will be trucated to '" & _
Left(Target.Value, MaxLen) & "'."
Application.EnableEvents = False
Target.Value = Left(Target.Value, MaxLen)
Application.EnableEvents = True
End If
End Sub
To install this code, right click the tab at the bottom of the worksheet,
select View Code from the popup menu that appears and then copy/paste the
above code into the code window that appeared. Now, go back to your
worksheet and try to enter more than 10 characters into a cell in Column C.