Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Limit to 5 characters...

Dear all,

Is there any ways to limit the number of alphabets you key in the cell and
move the to the next cell? For example if you enter "circular" which has 8
characters, is there a way such that:
A B C
1 circu
2 lar
3

Please help..... Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Limit to 5 characters...

Maybe you could tinker around with Data Validation
Under Allow, there's an option: Text length
to restrict inputs into cells
(there's no auto-overflow feature, though)
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:22,500 Files:370 Subscribers:66
xdemechanik
---
"Astro" wrote:
Is there any ways to limit the number of alphabets you key in the cell and
move the to the next cell? For example if you enter "circular" which has 8
characters, is there a way such that:
A B C
1 circu
2 lar
3

Please help..... Thank you.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Limit to 5 characters...

You can't do what you want while the typing is taking place, but you can
when the user finishes typing (signaled by hitting Enter or taking an action
which moves the highlight to a new cell). Right click the tab at the bottom
of the worksheet you want this functionality for, select View Code from the
popup menu that appears and then copy/paste the following into the code
window that appeared...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Delta As Long
Dim TargetText As String
If Not Intersect(Target, Columns("A")) Is Nothing Then
On Error GoTo Whoops
Application.EnableEvents = False
TargetText = Target.Value
Do While Len(TargetText)
Target.Offset(Delta).Value = Left(TargetText, 5)
Delta = Delta + 1
TargetText = Mid(TargetText, 6)
Loop
Target.Offset(Delta).Select
End If
Whoops:
Application.EnableEvents = True
End Sub

That's it. Go back to the worksheet and type something into any cell in
Column A.

--
Rick (MVP - Excel)


"Astro" wrote in message
...
Dear all,

Is there any ways to limit the number of alphabets you key in the cell and
move the to the next cell? For example if you enter "circular" which has 8
characters, is there a way such that:
A B C
1 circu
2 lar
3

Please help..... Thank you.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a limit on characters allowed Lorie Excel Discussion (Misc queries) 3 July 3rd 07 03:25 PM
characters object limit Batailleye Excel Discussion (Misc queries) 4 June 26th 07 02:39 AM
limit of characters in Excell Jola Excel Discussion (Misc queries) 1 September 20th 06 10:52 AM
Can I limit a cell to 2 characters? Frankc Excel Discussion (Misc queries) 2 August 11th 05 01:03 AM
Can I limit a cell to 72 characters? How? Chris Excel Discussion (Misc queries) 2 December 28th 04 04:57 PM


All times are GMT +1. The time now is 03:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"