InputBox Question

  • Thread starter Thread starter Les Stout
  • Start date Start date
L

Les Stout

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

Les Stout
 
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"
 
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
 
Back
Top