How about this:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range, MyStr As String, Ans As String
If Not Intersect(Target, Columns("A")) Is Nothing Then
For Each cell In Intersect(Target, Columns("A"))
If Len(cell.Value) > 40 Then
MyStr = cell
Do
Ans = Application.InputBox("This cell cannot contain over 40 character, please shorten description", _
"Shorten this description", MyStr, Type:=2)
If Ans = "False" Then
'Loop will restart
ElseIf Len(Ans) <= 40 Then
cell = Ans
Exit Do
Else
MyStr = Ans
End If
Loop
End If
Next cell
End If
End Sub
Bookmarks