Only display certain amount of xters..?

J

Jorge

Hello

I know this is probably easy but I don't know how...

Is there a way in Excel in order to just limit the characters displayed in a
cell(s)?
ie
a person enters "Flowers: in a cell - I want just the first 6 to display
"Flower"...
is there a way to do this?

Thanx!
Jorge
 
R

RagDyer

Is it important that the cell *contain all* the input characters, and *just
display* the first six,
OR ...
Will *limiting the input* to just six characters be good enough?

If limitation is good enough, you can use "DataValidation".

Select the cell(s) and then,
<Data> <Validation> <Settings> tab,
Allow box = >Text Length<
Data box = >Less Then or Equal To<
Maximum box = >6<

You can then enter a warning message that will display when the cell is
selected:
"InPut Message" tab, then
Check "Show Input Message When Cell Is Selected",
And, for example, enter in the "Title" box::
Limitation<
And, in the "Message" box enter:
Maximum 6 Characters Allowed<.

--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


Hello

I know this is probably easy but I don't know how...

Is there a way in Excel in order to just limit the characters displayed in a
cell(s)?
ie
a person enters "Flowers: in a cell - I want just the first 6 to display
"Flower"...
is there a way to do this?

Thanx!
Jorge
 
J

Jorge

thank you...

RagDyer said:
Is it important that the cell *contain all* the input characters, and *just
display* the first six,
OR ...
Will *limiting the input* to just six characters be good enough?

If limitation is good enough, you can use "DataValidation".

Select the cell(s) and then,
<Data> <Validation> <Settings> tab,
Allow box = >Text Length<
Data box = >Less Then or Equal To<
Maximum box = >6<

You can then enter a warning message that will display when the cell is
selected:
"InPut Message" tab, then
Check "Show Input Message When Cell Is Selected",
And, for example, enter in the "Title" box::
And, in the "Message" box enter:

--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


Hello

I know this is probably easy but I don't know how...

Is there a way in Excel in order to just limit the characters displayed in a
cell(s)?
ie
a person enters "Flowers: in a cell - I want just the first 6 to display
"Flower"...
is there a way to do this?

Thanx!
Jorge
 
J

Jorge

Ok tried this but lemme splain further...

I'd like the person even if they put 7 characters in field..
not to even tell them its wrong just enter the first 6 regardless.

any suggs?
 
D

Dave Peterson

You could use a worksheet event that truncates the value at 6 characters:

right click on the worksheet tab that should have this behavior. Select view
code and paste this into the code window:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("a1:a10")) Is Nothing Then Exit Sub

On Error GoTo errHandler:
Application.EnableEvents = False
Target.Value = Left(Target.Value, 6)

errHandler:
Application.EnableEvents = True

End Sub

I checked in cells A1:A10.
 
J

Jorge

HA! yes... that'll do it good...

If I wanted the whole column I'd do A1:A65536..

Super.
Jorge
 

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