Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Limit Number Of Characters Allowed In A TextBox

I placed a textbox on my worksheet using the drawing toolbar, and
would like to limit the number of characters that can be entered. As
of right now the textbox allows the user to input more characters than
it can actually display. Does anyone know how to limit the number of
characters to avoid this problem?

John

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Limit Number Of Characters Allowed In A TextBox

Use a text box from the Controls toolbox which has a MaxLength property.

NickHK

"mastermind" wrote in message
ups.com...
I placed a textbox on my worksheet using the drawing toolbar, and
would like to limit the number of characters that can be entered. As
of right now the textbox allows the user to input more characters than
it can actually display. Does anyone know how to limit the number of
characters to avoid this problem?

John



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Limit Number Of Characters Allowed In A TextBox

I understand that the control textbox has the ability to set a maximum
length, but it lacks a number of other formatting features that I
would like to keep. I have tried to get the control textbox to look
the way I want, but it just doesn't have the flexibility. If I could
just get a code a limit for the drawing toolbar textbox it would be
perfect. Thanks for your help though.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Limit Number Of Characters Allowed In A TextBox

The problem is that these objects do not have events, so you cannot receive
notification of any changes nor do they have properties (for your purposes)
that you can set.
You could have a button to run code that checks the length of text entered,
but that would only be AFTER the user had finished.

maybe use a Rich Text Box instead ?
But be awa
http://support.microsoft.com/kb/827742

NickHK

"mastermind" wrote in message
ups.com...
I understand that the control textbox has the ability to set a maximum
length, but it lacks a number of other formatting features that I
would like to keep. I have tried to get the control textbox to look
the way I want, but it just doesn't have the flexibility. If I could
just get a code a limit for the drawing toolbar textbox it would be
perfect. Thanks for your help though.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 138
Default Limit Number Of Characters Allowed In A TextBox

Code for what? The drawing textbox? You can't attach code to this object and
there is no event you could influence. All you could do is write code for a
worksheet event and check your textbox - AFTER the user has input a text
beyond your set limit. Then what? Cut the text to the desired length? It
will be a messy solution, no comparison to the slick possibilities offered
by the control box textbox or even a simple cell with its data validation
options.

You didn't elaborate on the formatting features that you think are missing
with these other solutions. To me the old Forms controls (which I guess MS
offers only for backward compatibility) are among the least flexible objects
in Excel, so I'm really curious to know which advantage they provide.

Joerg


"mastermind" wrote in message
ups.com...
I understand that the control textbox has the ability to set a maximum
length, but it lacks a number of other formatting features that I
would like to keep. I have tried to get the control textbox to look
the way I want, but it just doesn't have the flexibility. If I could
just get a code a limit for the drawing toolbar textbox it would be
perfect. Thanks for your help though.




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
text exceeds allowed number of characters per cell majestic357 Excel Worksheet Functions 1 September 19th 08 11:10 PM
Is there a limit on characters allowed Lorie Excel Discussion (Misc queries) 3 July 3rd 07 03:25 PM
Limit the number of characters that a cell contains Donna Excel Worksheet Functions 1 October 13th 05 05:00 PM
a way to limit the characters allowed in a cell? EmRit24 Excel Worksheet Functions 3 April 29th 05 09:30 PM
limit number of characters in a cell abfabrob Excel Discussion (Misc queries) 9 February 11th 05 04:19 PM


All times are GMT +1. The time now is 02:42 PM.

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"