Limit Number Of Characters Allowed In A TextBox

M

mastermind

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
 
M

mastermind

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.
 
N

NickHK

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 aware:
http://support.microsoft.com/kb/827742

NickHK
 
J

Joerg

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
 

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