Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc
|
|||
|
|||
![]()
I have seen a lot of posts talking about how to "limit" the text input
of a cell to a certain number of characters, but using the data validation option does not stop the user from entering more than a defined number, it just warns that it is invalid. What can I do to make typing more than 36 characters impossible? I just want the input to stop after 36, and if data is pasted into the cell, I would want it cut off at 36. Thanks for any help you can give. -Erich |
#2
![]()
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi
AFAIK this is not possible in a cell direct as a macro can't run while you're in Edit mode -- Regards Frank Kabel Frankfurt, Germany "Agent37" schrieb im Newsbeitrag om... I have seen a lot of posts talking about how to "limit" the text input of a cell to a certain number of characters, but using the data validation option does not stop the user from entering more than a defined number, it just warns that it is invalid. What can I do to make typing more than 36 characters impossible? I just want the input to stop after 36, and if data is pasted into the cell, I would want it cut off at 36. Thanks for any help you can give. -Erich |
#3
![]()
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc
|
|||
|
|||
![]()
Data validation option DOES stop the user from entering more than a defined
number and it DOESN'T. It DOES if two conditions concur: 1. within the Validation dialog window you go to tab 'Error Alert', check 'Show error alert after...' box and select Stop from the 'Style' dropdown. 2. the user manually enters the value or a formula returning that value into each individual cell. It DOESN'T if the user copy/paste the value into the cell, copies values or formulas by dragging the little + in the bottom-right corner of the cell, or enters the value via VBA. To ensure there are not more than 36 characters in a cell you could use a combination of the Validation option and the below code: Private Sub Worksheet_Change(ByVal Target As Range) Dim MyRng As Range Set MyRng = Range("A1") If MyRng.Characters.Count 36 Then MyRng = Left(MyRng, 36) MsgBox "Your text is too long and" & Chr(13) _ & "will be cut to 36 charachters." End If End Sub KL "Agent37" wrote in message om... I have seen a lot of posts talking about how to "limit" the text input of a cell to a certain number of characters, but using the data validation option does not stop the user from entering more than a defined number, it just warns that it is invalid. What can I do to make typing more than 36 characters impossible? I just want the input to stop after 36, and if data is pasted into the cell, I would want it cut off at 36. Thanks for any help you can give. -Erich |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
columns limit in excel 2003 | Excel Discussion (Misc queries) | |||
limit text length in a text box in excel 2003 | New Users to Excel | |||
Restrict-Filter-Limit-Validate user input in Excel | Excel Discussion (Misc queries) | |||
Limit input in a textbox | Excel Programming | |||
Limit character input | Excel Programming |