ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   InputBox Question (https://www.excelbanter.com/excel-programming/384735-inputbox-question.html)

Les Stout[_2_]

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

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***

JMay

InputBox Question
 
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"




"Les Stout" wrote:

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

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***


Les Stout[_2_]

InputBox Question
 
Thanks so much, will implement.

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***

[email protected]

InputBox Question
 
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

On Mar 7, 4:03 pm, Les Stout wrote:
Hi all, is it possible to limit the number of text put into an input box
?

Les Stout

*** Sent via Developersdexhttp://www.developersdex.com***




Les Stout[_2_]

InputBox Question
 
Thanks very much Paul, your input is much appreciated

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 10:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com