InputBox condition

S

Sasa

I was thinking about this thing. Is there a possibility to
set condition to InputBox funtion like that: user cannot
type more than 9 characters and when he put there more
then 9, MsgBox comes out and tells him that he cannot
write more than 9.

Or more easier sollution to set InputBox maximum string
lenght to 9 characters.

Is this possible?

Thanks.

Sasa
 
J

Jezebel

Sasa said:
I was thinking about this thing. Is there a possibility to
set condition to InputBox funtion like that: user cannot
type more than 9 characters and when he put there more
then 9, MsgBox comes out and tells him that he cannot
write more than 9.

Or more easier sollution to set InputBox maximum string
lenght to 9 characters.

Is this possible?

No. You'll have to create a UserForm of your own.
 
J

Jonathan West

Hi Sasa,

If you want a msgbox to appear over the input box as soon as more than 9
characters are typed, then this is impossible, you'll have to create a
UserForm to do this.

If you just want to truncate the ltngth of the string to the first 9
characters, then that can be done using the Left function. If you want to
warn the user that he has typed more than 9 characters, and that the string
will be shortened, then you can use the Len function to check the length of
the string returned by the input box.
 

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