text exceeds allowed number of characters per cell

M

majestic357

I have 4 cells in a work sheet that I have to type or copy information into.
This cell always has more than 250 characters. What I wanted to do was set
up a conditional formatting statement that will turn all text greater than
250 characters red. The cell will allow you to type in and exceed the 250
characters. I can set up a validation to tell me when It exceeds the 250
characters? or, is there a way to stop the data entry at 250 characters per
cell?
Another option I have thought about but do not know if it will work in excel
2007. is after 200 characters it pushes the remianing text to the cell below
it. I am taking suggestions to address this issue.
 
O

Otto Moehrbach

This little macro will look at every entry in the sheet as it is made, and
if the number of characters exceeds 200, it will put the first 200 in that
cell and the remainder in the cell beneath it. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Len(Target) > 200 Then
Target.Offset(1) = Right(Target, Len(Target) - 200)
Target = Left(Target, 200)
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top