InputBox Question

L

Les Stout

Hi all, is it possible to limit the number of text put into an input box
?

Les Stout
 
G

Guest

The InputBox allows for a Title parameter Where you can instruct the user to
Not enter over 8 text characters (say), but additionaly put in a line of code
following the Inputbox line, somthing like..

ans = Incputbox("Enter proper text - Limit to 10 Characters..")
if Len(ans) > 10 then
Msgbox "Too many characers, limit to 10 or less"
 
P

paul.robinson

Hi
Public Sub test()
Dim InputOK As Boolean, myText As String
Do
InputOK = True
myText = InputBox(prompt:="Input 8 characters or less")
If Len(myText) > 8 Then
MsgBox "Too many characters!"
InputOK = False
End If
Loop Until InputOK
End Sub

regards
Paul
 

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