Private Sub Worksheet_Change(ByVal Target As Range)
Dim a1, a2, i
a1 = Array("D5", "I5", "C29", "I29", "C30", "B31")
a2 = Array(18, 16, 18, 16, 47, 38)
i = Application.Match(Target.Address(0, 0), a1, 0)
If IsNumeric(i) Then If Len(Target) > a2(i - 1) _
Then Target = Left(Target, a2(i - 1))
End Sub