#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Limiting text length

I need to know if it is possible to have a cell with a limited text length of
95 automatically go to the next line when the user has reached the limit. In
other words, I want the user to be able to keep typing without hitting enter
and receiving the message "you have exceeded the limit that the user set". I
would appreciate any help.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 293
Default Limiting text length

Data:Validation and From the drop down list chosse text length.

Your messages can be entered at this point as well

Stew

"patsy" wrote:

I need to know if it is possible to have a cell with a limited text length of
95 automatically go to the next line when the user has reached the limit. In
other words, I want the user to be able to keep typing without hitting enter
and receiving the message "you have exceeded the limit that the user set". I
would appreciate any help.

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Limiting text length

Excel has no way of knowing when you have finished typing in a cell until
you hit Enter or Tab or arrow out of the cell.

VBA code won't run while you are in Edit mode.

About the best you can do is hit Enter and then let Excel count the nunmber
of characters and move any past 95 to another cell.

No message, just move the extra characters to the cell below.

This can be done.......if you want code post back.

Question. Is the limit due to the need for 95 char limit for export to
another application or what?


Gord Dibben MS Excel MVP



On Tue, 16 Dec 2008 09:12:04 -0800, patsy
wrote:

I need to know if it is possible to have a cell with a limited text length of
95 automatically go to the next line when the user has reached the limit. In
other words, I want the user to be able to keep typing without hitting enter
and receiving the message "you have exceeded the limit that the user set". I
would appreciate any help.

Thanks


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Limiting text length

Gord,
I would like to know how to move excess text from my cell in the
fist sheet to my second sheet where I already have a cell setup to recieve
it. How is it done?
Thanks
--
Steve Edgar


"Gord Dibben" wrote:

Excel has no way of knowing when you have finished typing in a cell until
you hit Enter or Tab or arrow out of the cell.

VBA code won't run while you are in Edit mode.

About the best you can do is hit Enter and then let Excel count the nunmber
of characters and move any past 95 to another cell.

No message, just move the extra characters to the cell below.

This can be done.......if you want code post back.

Question. Is the limit due to the need for 95 char limit for export to
another application or what?


Gord Dibben MS Excel MVP



On Tue, 16 Dec 2008 09:12:04 -0800, patsy
wrote:

I need to know if it is possible to have a cell with a limited text length of
95 automatically go to the next line when the user has reached the limit. In
other words, I want the user to be able to keep typing without hitting enter
and receiving the message "you have exceeded the limit that the user set". I
would appreciate any help.

Thanks



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Limiting text length

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1" 'edit to suit
Dim cell As Range
On Error GoTo ws_exit:
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If Len(.Value) 20 Then
Sheets("Sheet2").Range("A1").Value = _
Right(.Value, Len(.Value) - 20)
.Value = Left(.Value, 20)
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

Right-click on the sheet tab and "View Code". Copy/paste the code into that
sheet module.

Edit to suit. Alt + q to return to the Excel window.


Gord

On Sat, 14 Feb 2009 20:32:01 -0800, Steve Edgar
wrote:

Gord,
I would like to know how to move excess text from my cell in the
fist sheet to my second sheet where I already have a cell setup to recieve
it. How is it done?
Thanks


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
Limiting text entries Help4me Excel Discussion (Misc queries) 7 December 4th 08 11:24 PM
limiting text entry of columns tobypitblado Excel Discussion (Misc queries) 3 September 16th 08 06:00 PM
Cell shatracter length limiting. Bob Excel Worksheet Functions 2 January 26th 07 12:29 PM
limiting rows of text in a textbox object? mark Excel Worksheet Functions 1 May 19th 06 08:06 PM
Limiting physical length of text in a text box control XL2Know Excel Discussion (Misc queries) 1 October 6th 05 01:55 PM


All times are GMT +1. The time now is 07:35 AM.

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

About Us

"It's about Microsoft Excel"