I found some code that will actually truncate the characters in the cell. It does require the spreadsheet to be saved as a Macro enabled workbook.
For current data, you can use this code to truncate:
Open VBA (Alt+F11), point to Insert->Module and copy&paste the following code into this new module and run it by pressing F5.
Please remember to change column reference in code (it is 1 = A column)
Sub TruncateCell()
Dim rng As Range
Dim cll As Range
Set rng = Sheet1.Columns(1)
Set rng = Sheet1.Range(rng.Cells(1, 1), rng.Cells(65536, 1).End(xlUp))
For Each cll In rng.Cells
cll.Value = Left(cll.Value, 8)
Next cll
End Sub
Truncating for new values :
Goto VBA, Project Explorer (Ctrl + R), double click on the Thisworkbook object and copy and paste the following code into this module declaration section. Set the condition for your sheet and column (it is Column A - Target.Column = 1 and Sheet1 in code)
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Sh.Name = Sheet1.Name Then
If Target.Column = 1 Then
If Len(Target.Value) > 8 Then
Target.Value = Left(Target.Value, 8)
End If
End If
End If
End Sub
This seemed to work. So even though it does not stop, the user can only see up to 8 of the characters.
Bookmarks